Cairo: Meeting a key demand of the opposition protest movement, the Prime Minister appointed by ousted President Hosni Mubarak has resigned, Egypt's military rulers said on Thursday.

Shafiq's resignation came a day after he made a widely criticized appearance on a popular talk show, in which he defended the State Security Agency and sought to distance himself from Mubarak, a longtime friend from the time the two served in the Air Force.

Shafiq, who was the Civil Aviation Minister in the previous Cabinet, was grilled by other guests on the program, including best-selling novelist Alaa al-Aswani.

In a failed attempt to quiet the anti-government protests, Mubarak named former Air Force officer Ahmed Shafiq to be Prime Minister shortly after the unrest began on January 25. Mubarak stepped down on February 11 and the military took control of the country, but Shafiq remained in office at the head of a caretaker government.

A brief statement posted on the military's official website said it had chosen former Transport Minister Essam Sharaf as the new Prime Minister and asked him to form a new caretaker Cabinet to run the government throughout a transition back to civilian rule. Sharaf served in the Cabinet between 2004 and 2006. He quit amid an uproar over a series of deadly train accidents blamed on government negligence.

Sharaf, an engineer by profession, has visited the anti-Mubarak protesters in Cairo's central Tahrir Square, the uprising's epicenter, something that endeared him to the youth groups behind the opposition movement.

Mohamed ElBaradei, a leading pro-democracy activist and Noble Peace Prize laureate, welcomed Shafiq's departure and thanked the military for "listening to the people."

ElBaradei is a likely presidential candidate, but his credentials as a leader are persistently questioned by some because of the decades he spent abroad, first in the Egyptian diplomatic service and later as a UN official.

Leaders of the 18-day uprising that forced out Mubarak had been pressing the military to fire Shafiq, arguing that a Prime Minister sworn in by the ousted leader should not stay in office. They also argued that his Cabinet was filled with figures from the old regime.