The previous prime minister, Chung Hon-won, will remain in office until Mr Ahn is confirmed by parliament.

Mr Chung resigned amid criticism of the government's handling of the ferry sinking on 16 April.

Most of the 476 people on the Sewol ferry, which sank on the way to Jeju Island, were high school students. Only 172 people survived, including 22 of the 29 crew members.

Ms Park named Mr Ahn "in order to eliminate ill practices in our society and accumulated evils in the bureaucracy revealed through the Sewol accident and push for national rebuilding", a government spokesman said.

Mr Ahn, who served as a Supreme Court judge from 2006 to 2012, has a reputation as an "upright prosecutor", Yonhap news agency said.

He will be tasked with ironing out problems in government institutions and the public sector highlighted by the Sewol disaster.

Meanwhile, two other senior officials - one of whom came under heavy criticism following the Sewol disaster - have also resigned from their posts.

Ms Park has accepted the resignations of the country's spy chief and the head of the National Security Council.

Last month, Ms Park also announced that the coastguard would be disbanded in the wake of the ferry disaster, after she said it "failed to fulfil its original duties".

A new safety agency would handle rescue duties, with investigative functions passing to the police.

Amid harsh criticism in the wake of the disaster over national practices and attitudes, the government is keen to present the high-level reshuffle as a clean slate, and to convince the public it can deliver real change, says the BBC's Lucy Williamson in Seoul.

An interim investigation found that the ferry was overloaded, carrying three times its approved amount of cargo, and that a sharp turn destabilised it and caused it to capsize.

The government reshuffle comes as South Korea prepares to conduct local elections in June, the first since Ms Park was elected into office in 2013.