By Idrees Ali

DJIBOUTI, April 23 (Reuters) - U.S. Defense Secretary Jim Mattis arrived in Djibouti on Sunday to visit an important military base at the southern entrance to the Red Sea used as a launch pad for operations in Yemen and Somalia.

The visit, part of Mattis' week-long trip to the Middle East and Africa, comes as the United States has been increasing pressure on militant groups such as al Shabaab in the region.

The U.S. base, which has about 4,000 personnel, is located just miles from a Chinese one, still under construction, which has caused concern to some U.S. officials.

Djibouti, which is about the size of Wales, is on the route to the Suez Canal. The tiny, barren nation, sandwiched between Ethiopia, Eritrea and Somalia, and also hosts Japanese and French bases.

The White House recently granted the U.S. military broader authority to strike al Qaeda-linked al Shabaab militants in Somalia.

Al Shabaab has been able to carry out deadly bombings despite losing most of its territory to African Union peacekeepers supporting the Somali government.

The group's insurgency aims to drive out the peacekeepers, topple Somalia's western-backed government and impose its strict version of Islam on the Horn of Africa state. The United States recently sent a few dozen troops to Somalia to help train members of the Somali National Army.

The United States is also carrying out strikes in Yemen against al Qaeda in the Arabian Peninsula (AQAP).

AQAP boasts one of the world's most feared bomb makers, Ibrahim Hassan al-Asiri, and it has been a persistent concern to the U.S. government ever since a 2009 attempt to blow up a Detroit-bound airliner on Christmas Day.

The militant group has also taken advantage of a civil war pitting the Iran-aligned Houthis against the Saudi-backed government of President Abd-Rabbu Mansour Hadi, to try to widen its control and influence in the impoverished Arabian Peninsula country, one of the poorest in the Middle East.

PIRACY

Mattis' trip also comes amid a recent surge in piracy off the coast of Somalia.

The sudden string of attacks by Somali pirates comes after years without a reported incident. Attacks peaked with 237 in 2011 but then declined steeply after ship owners improved security measures and international naval forces stepped up patrols.

This month has seen a new rash of attacks, with two ships captured and a third rescued by Indian and Chinese forces after the crew radioed for help and locked themselves in a safe room.

A U.S. defense official, speaking on the condition of anonymity, said the recent incidents were concerning but not surprising.

The official said international shipping companies had started to become complacent about their security. At the same time poverty and limited economic opportunities meant that piracy was bound to increase.

The recent incidents, the official said, are likely to mean that countries patrolling the waters are going to think twice before they reduce their presence.

(Reporting by Idrees Ali; editing by Clelia Oziel) ((Idrees.Ali@thomsonreuters.com))