ADDIS ABABA, Ethiopia — President Trump and his Kenyan counterpart, Uhuru Kenyatta, announced their intention Thursday to work toward a free-trade agreement between the two countries in what would be a first for U.S. trade relations in sub-Saharan ­Africa.

“There is enormous potential for us to deepen our economic and commercial ties,” said U.S. Trade Representative Robert E. Lighthizer, who added that both countries sought a “comprehensive, high-standard agreement.” Trump was more circumspect, telling reporters at the White House that a deal “probably” would happen.

Kenya and the United States share around $1 billion in trade annually, and Washington sees Kenya as a key ally in a joint military campaign against militant al-Shabab fighters in neighboring Somalia. Kenya is also East Africa’s economic engine, and it is home to a growing number of industries — as well as billions of dollars in strategic Chinese investments that Washington is trying to counter.

A free-trade deal between the United States and Kenya would more or less replace an aging agreement called the African Growth and Opportunity Act, which allows many African countries to export goods to the United States without quotas or tariffs, but it expires in 2025. The only bilateral agreement the United States has on the continent was signed with Morocco in 2004.

In a speech at the U.S. Chamber of Commerce in Washington on Thursday, Kenyatta said shared values made the United States and Kenya natural trading partners.

“It is this shared common value — belief in freedom, democracy and enterprise — that makes me believe that the United States can and should be the partner of choice for the African continent,” Kenyatta said.

Those remarks stood in contrast to those Kenyatta made a day earlier at the Atlantic Council in Washington, in which he warned Americans against seeing Africa as a ground for economic proxy wars with China.

The world’s two largest economies behave “like Africa is for the taking,” he said. “We don’t want to be forced to choose. . . . We must begin to look at Africa as the world’s biggest opportunity, and I believe that you can dare to look at it with a fresh eye.”

African heads of state are meeting this weekend in the Ethio­pian capital, Addis Ababa, as part of an African Union summit to discuss their own continent-wide free-trade agreement. It has been signed by all but one of Africa’s 54 countries but has yet to come into effect. Lighthizer said bilateral agreements with the United States were a model for other African countries and were meant to complement the continental accord.

“We have provisions in the agreement which require a country to notify us when it intends to enter into a [bilateral] free-trade agreement,” said Albert Muchanga, the African Union’s commissioner for trade and industry. “And we also have provisions in the agreement which say any preferences given to a third party must also be given to other parties of the African Continental Free Trade Area. We are hopeful that the government of Kenya is going to brief us on the initiative that it is taking with the United States.”

Exports from Kenya to the United States tend to be some of the African country’s more refined products, such as honey, coffee and textiles, said Kwame Owino, a Kenyan economist. Kenya’s trade with China tends more toward raw commodities such as avocados and flowers.

“The clincher of a Kenyan agreement with the U.S. will be if Kenya can secure more U.S. investment in those refined goods, giving U.S. companies a regional hub for those products and a steppingstone to creating similar agreements with other East African countries,” Owino said.

China has been Africa’s biggest trading partner for more than a decade, however, and U.S. companies would be playing a serious game of catch-up. Governments like Kenyatta’s are also loath to be seen as taking sides in the U.S.-China competition. The signing of a free-trade agreement with Kenya may give Washington a chance to claim it has won over a partner, but Kenyans are unlikely to see it that way.

“There’s going to be a real temptation for American officials to say we are more reliable, trustworthy and so on, and Kenyans will find that distasteful. Kenyans shouldn’t feel like they need to make a choice,” said Judd Devermont, director of the Africa Program at the Center for Strategic and International Studies in Washington.

In Kenya, industry representatives saw Thursday’s announcement as a largely positive step that might spur economic growth and help Kenya raise standards to meet new American requirements for export.

“The challenge to take advantage of a deal will mostly be on our side, to raise our standards to widely be able to get those clearances,” said Daniel Mbithi, CEO of the Nairobi Coffee Exchange. “Maybe a new agreement can help us get there, and then the market can be widened.”