Palestinian politics have been paralysed for 15 years since Hamas, a US and EU designated terrorist group, and Fatah fought a factional conflict for control of the Palestinian Authority that led to Mr Abbas' party being driven out of the Gaza Strip. Repeated reunification attempts have failed and Palestinians have not been able to vote for their leadership since 2006.
The pair met on the sidelines of Algerian independence anniversary celebrations, Algerian state TV said on Tuesday.
Representatives of the Palestinian Authority and Hamas also attended this meeting, which the broadcaster called “historic”.
Neither side has released details of the conversation but it comes just a year after the latest efforts to hold elections fell apart over what Mr Abbas said was Israel's refusal to allow the vote in occupied East Jerusalem. Experts, however, said that divisions between Hamas and Fatah were the likely motivator.
The last official face-to-face meeting between Mr Abbas and Mr Haniyeh took place in Doha in October 2016, but meetings between officials from both sides still take place.
Earlier this year, Algeria hosted talks between high-ranking Hamas and Fatah officials which ended without any public agreements.
This week's meeting came as Algerian President Abdelmadjid Tebboune marked his country's 60th anniversary of its independence from France.
Mr Abbas' secular Fatah party, which dominates the Palestinian Authority that rules the Israeli-occupied West Bank, has been at loggerheads with Hamas since elections in 2006, when Hamas took control of Gaza.
Mr Tebboune and Mr Abbas signed a document to name a street “Algeria” in the West Bank city of Ramallah.
Algeria's president hosted several foreign dignitaries on Tuesday to watch a huge military parade to mark independence in 1962, when Algeria broke free from 132 years of French occupation.