Pakistan's parliament elected opposition lawmaker Shahbaz Sharif as prime minister Monday.
He replaces Imran Khan, whom Parliament had voted out of office early Sunday.
Shahbaz Sharif was elected with 174 votes after more than 100 lawmakers from Khan's Pakistan Tehreek-e-Insaf, or Pakistan Justice Party, left the National Assembly in protest.
"Mohammad Shahbaz Sharif is declared to be the prime minister of the Islamic Republic of Pakistan," announced the acting speaker, Asad Sadiq.
Sharif is the younger brother of former Prime Minister Nawaz Sharif.
The older Sharif was forced to resign from office after a corruption investigation.
Shahbaz Sharif will have just enough votes to pass laws in the 342-seat assembly.
Imran Khan served as Pakistan's prime minister for three years and eight months.
On April 3, Khan tried to avoid a vote to withdraw support for his leadership.
He dismissed Parliament and called for early elections.
The opposition appealed to the nation's Supreme Court and it ruled to return the dismissed Parliament to power four days later.
On Sunday night, Khan urged hundreds of thousands of supporters to protest his ouster.
He described the new leadership as an "imposed government."
Khan's supporters marched in cities across Pakistan.
Khan has demanded that elections be held before August 2023, the date set.
He also accuses the opposition of working with the United States to remove him from power.
The U.S. State Department has denied any involvement in Pakistani politics.
The largest among Pakistan's opposition parties--the Pakistan People's Party, led by the son of murdered former Prime Minister Benazir Bhutto, and the Pakistan Muslim League, headed by Shahbaz Sharif--have been damaged by reports of widespread corruption.
Nawaz Sharif served as Pakistan's prime minster three times.
He was ousted in a military overthrow in 1999 and removed again by the Supreme Court in 2015.
After he was found guilty of financial wrongdoings, Nawaz was banned from holding office and left Pakistan.
Benazir Bhutto served two terms as prime minister in the 1980s and 1990s.
Bhutto was killed in a 2007 suicide attack while campaigning.
She was the daughter of former president and prime minister Zulfikar Ali Bhutto.
Her husband, Asif Ali Zardari, who served as president of Pakistan after 2008 elections, has spent more than seven years in prison, after a court ruled him guilty of corruption.
Khan came to power in 2018, promising to break family rule in Pakistan.
His opponents claimed he won the elections with help from the powerful military.
The military has ruled Pakistan for half of the country's 75-year history.
I'm Caty Weaver.