Mr Mattis planned to meet President Ismail Omar Guelleh and greet US and French troops.
The US operates drone aircraft from Djibouti for surveillance and combat missions against extremist groups in Yemen, Somalia and elsewhere in the region.
The visit, part of Mr 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 and Al Qaeda.
The US base, which has about 4,000 personnel, is located just a few kilometres from a Chinese one, still under construction, which has caused concern to some US officials.
Djibouti, a tiny, barren nation, sandwiched between Ethiopia, Eritrea and Somalia, and on the route to the Suez Canal, also hosts Japanese and French bases.
For years the US has operated a fleet of armed drones, initially from Djibouti’s Camp Lemonnier, where French troops also are based, and now from a separate airfield named Chabelley.
“For [the defence department] Camp Lemonnier and Chabelley are critical in terms of logistics. They support multiple US combat command”, a senior defence official said.
The White House recently granted the US military broader authority to strike Al Shabaab 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 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.
The extremist group’s Yemen wing boasts one of the world’s most feared bomb makers, Ibrahim Hassan Al Asiri, and it has been a persistent concern to the US government ever since a 2009 attempt to blow up a Detroit-bound airliner on Christmas Day.
The militant group has also taken advantage of the civil war there.
Another senior US defence official played down any concerns about China’s base construction in Djibouti.
“At this point I don’t see why we should not be able to comfortably coexist with the Chinese presence, the way we do with the Japanese, the French ...” the official said last week.
Critics say China is trying to construct a so-called “pearl necklace” in the Indian Ocean — a reference to various ports in which China has direct interest in operations including Gwadar in Pakistan and the Colombo Port City in Sri Lanka.
However, General Thomas Waldhauser, commander of US troops in Africa, assured the US Senate’s armed forces committee in March that he had spoken to president Guelleh “and expressed our concerns about some of the things that are important to us about what the Chinese may or may not do”.
Djibouti took on added importance to the US military after the September 11 attacks, in part as a means of tracking and intercepting Al Qaeda militants fleeing Afghanistan after the US invaded that country in October 2001.
The US has a long-term agreement with Djibouti for hosting American forces; that pact was renewed in 2014.
Mr 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.
*Reuters, Agence France-Presse and Associated Press