Germany's ruling Christian Democrat Union has chosen Annegret Kramp-Karrenbauer as its new party leader, ending Angela Merkel's 18-year reign.

The CDU general secretary narrowly beat Friedrich Merz, a millionaire lawyer, in a run-off vote in Hamburg.

Ms Kramp-Karrenbauer, or AKK as she is also known, received 517 of 999 votes.

Mrs Merkel, who plans to serve out her term as chancellor until 2021, gave an emotional farewell speech on Friday at the special party conference.

As the head of Germany's largest party, Ms Kramp-Karrenbauer could now become the next German chancellor.

The former prime minister of the state of Saarland said: "I learned what it is to lead, and above all learnt that leadership is more about being strong on the inside than being loud on the outside."

She called for party unity in her first address as leader and brought Mr Merz and her other opponent, Health Minister Jens Spahn, to the stage, saying she would be "very happy" if they joined her in this task.

The 56-year-old was the favourite for party leader and Ms Merkel's choice to succeed her.

Earlier, during her farewell speech as party leader, Ms Merkel praised AKK for her 2017 electoral success in Saarland, in a clear hint of the chancellor's personal preference.

Who did she beat?
"I would have liked to win, but it was still fun," Mr Merz told his peers, asking them to back the new party leader.

The lawyer, who got 482 votes in a run-off, was a powerful player in the CDU in the early 2000s but left politics when he fell out with the chancellor.

Since then, the 63-year-old has built a career in the private sector and works for US investment firm BlackRock.

Mr Spahn, a former banker, was not seen as a likely winner and received 157 votes.

The 38-year-old - a divisive figure for many having ruffled feathers in the party and cabinet - said he would "stay in the team".

What has been the reaction?
Ms Kramp-Karrenbauer has sometimes been dubbed mini-Merkel or Merkel 2.0, neither nickname she particularly enjoys.

"I have read a lot about what I am and who I am," she told her party members, "Mini, a copy, simply 'more of the same'. Dear delegates, I stand before you as I am and as life made me, and I am proud of that."

Leaders of other German parties have rolled in their congratulations, such as Interior Minister Horst Seehofer, leader of CDU's sister party in Bavaria.

"You've got big shoes to fill," tweeted Andrea Nahles, leader of Mrs Merkel's coalition's junior partner, the Social Democrats.

"Good luck! Now it's time to solve problems: ensuring the future of pensions, recognising the value of work, strengthening cohesion in Europe. I offer good co-operation."

Not everyone is happy though - Sahra Wagenknecht, a left-wing leader, wrote on Twitter: "Merkel 2.0 is not a solution... Merkel's policy continues with AKK and social change is not possible."

Who is AKK?
Popular in her home state of Saarland and Berlin, she has an unpretentious style and a reputation for calm analysis, as well as political acumen.

Ms Kramp-Karrenbauer joined the CDU as a student in 1981 and rose up the ranks of state-level politics. The devout Catholic was seen as Ms Merkel's heir apparent and protégé.

Ms Kramp-Karrenbauer became the first woman to serve as a state minister for internal affairs in 2000 and the first woman to serve as prime minister of Saarland, a position she held from 2011 to 2018.

She is a Merkel loyalist, perceived as someone who will replicate much of the chancellor's style and policy.

However she has differentiated herself from her mentor, voting in favour of quotas for women on corporate boards and taking a tougher line on Russia.

She is also more conservative on social issues such as gay marriage, and has vowed to review the country's position on security and migration.