WASHINGTON — The Obama administration said Monday that it had signed a 20-year lease on its military base in Djibouti in the Horn of Africa, the only American installation on the continent and a staging ground for counterterrorism operations in Yemen and Somalia.

Djibouti, a country of fewer than one million people the size of New Jersey that borders the Red Sea and Gulf of Aden, has played an increasingly significant role in seeking to stabilize regional crises. The deal reflects the small country’s outsize strategic importance in helping the United States and other Western allies combat terrorists, pirates and smugglers in the region.

In a 40-minute meeting in the Oval Office, President Obama and Ismail Omar Guelleh, the president of Djibouti, covered a range of security and development issues, aides said. But the talks centered on the critical role played by Camp Lemonnier, a sprawling base of 4,000 American service members and civilians that serves as a hub for counterterrorism operations and training.

“Obviously, Camp Lemonnier is extraordinarily important not only to our work throughout the Horn of Africa but throughout the region,” said Mr. Obama, who visited Djibouti in 2006 as a United States senator.