Quoting from a "Joint Declaration of Peace and Friendship," Eritrean Information Minister Yemane Gebremeskel said on Twitter the "state of war that existed between the two countries has come to an end. A new era of peace and friendship has been ushered (in)."
"Both countries will work to promote close cooperation in political, economic, social, cultural and security areas," Yemane added.
He said the agreement was signed by Ethiopian Prime Minister Abiy Ahmed and Eritrean President Isaias Afwerki on Monday morning at state house in Asmara.
Images of the ceremony showed the two men sharing a wooden desk, backed by their nations' flags, as they simultaneously signed the document.
The declaration echoed comments made by Abiy at a dinner hosted by Isaias late Sunday, where he said diplomatic, trade, transport and communications ties would be re-established and borders re-opened.
"We agreed that the airlines will start operating, the ports will be accessible, people can move between the two countries and the embassies will be opened," Abiy said.
"We will demolish the wall and, with love, build a bridge between the two countries," he said.
Abiy left Asmara after signing the joint agreement on Monday.
Recent weeks of rapid rapprochement are aimed at ending decades of animosity, periods of outright conflict and many years of cold war between the two countries.
The thaw began last month when Abiy said Ethiopia would abide by a 2002 UN-backed ruling, made after a two-year frontier war, and hand back disputed border territory, including the flashpoint town of Badme, to Eritrea.
The re-establishment of diplomatic and trade ties after years of bitter separation could mean big benefits for both nations, and the wider Horn of Africa region, plagued by conflict and poverty.
Once a province of Ethiopia that comprised its entire coastline on the Red Sea, Eritrea voted to leave in 1993 after a decades-long, bloody independence struggle.
The break rendered Ethiopia landlocked, and the deterioration of relations due to the continuing cold war forced Ethiopia to rely on Djibouti for its sea trade.
Ethiopian access to Eritrea's ports will be an economic boon for both, as well as posing a challenge to the increasing dominance of Djibouti which had benefitted from importing and exporting the vast majority of goods to Africa's second-most populous country.
Free movement across the border will also unite, once again, two peoples closely linked by history, language and ethnicity.
Regional leaders welcomed the peace efforts with Rwanda's President Paul Kagame telling Abiy and Isaias, "We congratulate you and are with you," in a Twitter statement.
Kenya's Uhuru Kenyatta also congratulated the two leaders for, "choosing the path of talking to each other and beginning the journey of friendship."
Since taking office in April, Abiy has driven whirlwind reforms reversing some of the touchstone policies of the ruling Ethiopian People's Revolutionary Democratic Front (EPRDF).
He has released prominent dissidents from jail, announced the partial liberalisation of the economy, admitted the security forces use torture and pursued peace with Eritrea.