TOKYO — Parliament formally elected Shinzo Abe as prime minister on Wednesday, ending a three-year break from decades of near-constant rule by his conservative Liberal Democratic Party.

The victory puts Mr. Abe, 58, a former prime minister and an outspoken nationalist, at Japan’s helm as it faces the growing burden of its aging population, years of industrial decline and the challenge of an increasingly assertive China. The change in prime ministers is the seventh in six years, a high turnover that is itself a sign of the nation’s inability to escape its long economic funk.

Mr. Abe won the support of 328 members of the 480-seat lower house, a total that included votes from the Liberal Democrats’ coalition partner, a small Buddhist party.

Mr. Abe’s pro-business party won a landslide victory over the left-leaning Democratic Party in lower-house elections on Dec. 16. Earlier on Wednesday, Prime Minister Yoshihiko Noda and his cabinet resigned to make way for the new leader.