BERLIN — Serbia and Kosovo agreed on Monday to restore flights between their capitals for the first time in more than two decades, in a step toward reconciliation brokered by the United States at a time when the European Union is urging the two Balkan countries to resume talks.

The deal will open passenger and cargo flights between Belgrade and Pristina by the German-owned carrier Eurowings. It came after months of intense shuttle diplomacy by Richard Grenell, the United States ambassador to Germany, who was named special envoy for Serbia-Kosovo relations by President Trump last year.

Mr. Grenell said the key to reaching the agreement signed on Monday was ignoring the longstanding political conflicts between the two countries and focusing instead on the potential for economic ties.

“What we heard from the business community in Kosovo and from the business community in Serbia is we want a more normalized commerce structure and we need a flight,” Mr. Grenell said. “It’s the reason why we went after trying to figure out how do we make a direct flight for the first time in a generation.”