VALLETTA, Malta — A first-term lawmaker whose father was Malta’s president has been chosen to be the country’s new prime minister, replacing a leader who is stepping down amid demands for accountability over the 2017 murder of an anticorruption journalist.

The departing prime minister, Joseph Muscat, 42, said on Twitter on Sunday that he would formally resign as prime minister on Monday, leaving the role midway through his second term.

Eligible members of the governing Labour Party voted this weekend to choose a new prime minister, and a count on Sunday showed that the first-term lawmaker, Robert Abela, had received nearly 58 percent of ballots cast.

“I am humbled,” he told supporters. “There is only one winner today, the Labour Party.”

He was scheduled to address the party on Sunday afternoon.