Australia’s conservative lawmakers chose one of their own to become the country’s newest prime minister on Friday, after a vote that capped days of chaos in the capital and underscored the turbulence of the country’s politics.

Scott Morrison, who had been the country’s treasurer, was sworn in as the sixth prime minister in 11 years after a vote by the governing Liberal Party, in which he defeated Peter Dutton, a former home affairs minister, and Julie Bishop, the country’s foreign minister.

Josh Frydenberg, who had been energy minister under the ousted prime minister, Malcolm Turnbull, was elected deputy leader.

At a news conference shortly after the vote, Mr. Morrison said he and Mr. Frydenberg represented a “new generation” of Liberal Party leadership. After a week of contentious party infighting and back-room backstabbing, Mr. Morrison pledged to “heal our party.”