Xhafer YpiXhafer Bej Ypi (1880 - December 1940), a Bektashi Muslim, was an Albanian politician.
Ypi's parents were Asilan (a landowner) and Zavalani.
He was educated at a university in Constantinople.
As the leader of the Popular Party, in late December 1921 he formed a government where Fan S. Noli was the Minister of Foreign Affairs and Ahmed Zogu was the Minister of Internal Affairs. Until December 4, 1922, Ypi was Prime Minister, in 1922 after Noli's resignation he was also acting Minister of Foreign Affairs.
From December 2, 1922, to January 31, 1925, Ypi was a member of the High Council (the collegial Head of State, formally for William of Wied). In June 1924 he left Albania because of Noli's revolt, but he kept holding the post formally.
During Zog's Kingdom, Ypi was Chief Inspector of the Royal Court.
When the Italian occupation began, Ypi saluted the Italians who had "liberated" Albania "from the heavy slavery of the sanguinary Zogu". After King Zog had fled, from April 9 to April 12 Ypi was Chairman and Plenipotentiary for Justice of the Provisional Administration Committee, and as such acting head of state. From April 12, he was the Minister of Justice in Shefqet Verlaci's government. He was killed by an aerial bomb.