LONDON (Reuters) - In 2021, Keir Starmer considered resigning as leader of Britain's opposition Labour Party after it suffered a humiliating local election defeat to the governing Conservatives.

Three years later the 61-year-old former lawyer is poised to become prime minister, according to opinion polls that give him a lead of around 20 points, having healed many of the divisions in his party and put it on course to return to power after a 14-year absence.

He has done so by attacking Conservative infighting, restoring discipline in his own party, pushing Labour closer to the political centre and running a steady, if not revelatory, campaign for the July 4 election.

Though sometimes accused by critics of lacking charisma, Starmer's understated style has proved a strength for Labour as scandals, policy U-turns and plotting among the Conservatives diminished the governing party's standing.

Boris Johnson quit as prime minister as the Conservatives imploded in 2022, his successor Liz Truss lasted only 49 days in power, and Rishi Sunak has been unable to stop the infighting since becoming prime minister in October 2022.

"The turnaround has been extraordinary. Three years ago, even two years ago, we were nowhere," said one Labour lawmaker who has been critical of Starmer in the past.

"A big reason that we are where we are now is Liz Truss and Boris Johnson. But politics is always a mix of luck and skill. People want a grown-up, intelligent leader, and he has projected those qualities well."

Since taking over in April 2020 from Jeremy Corbyn, a left-winger who led Labour to a heavy defeat at the last election in 2019, Starmer has won support by presenting himself as what one senior party member said was a "decent, if a bit of a boring, bloke".

"I backed him even though he doesn't get my heart beating," said one Labour veteran who now sits in the House of Lords upper house of parliament.

The veteran described the risk-averse election campaign as "very much 'do nothing and wait for the Tories (Conservatives) to implode' ... because we can't promise new spending".

Another Labour lawmaker said: "I suspect we are on course for a large majority because the public hate the Tories more than at any other time I have ever known."

HARTLEPOOL SETBACK

It was a markedly different picture in 2021.

Back then, Starmer had just witnessed his party's defeat in Hartlepool, a northeastern English port town that for decades had backed Labour but had turned to the Conservatives under Johnson.

It was at this time that the man who had a year earlier promised to maintain Labour's "radical values and work tirelessly to get Labour into power" wondered whether he could carry on, a former aide and several Labour lawmakers said.

The defeat in Hartlepool was a terrible blow, according to a biography written by Tom Baldwin, a journalist, author and former Labour Party senior adviser, but Starmer was persuaded to continue by aides and his wife.

Starmer now oversees a changed party that looks set to take power in a country facing problems ranging from a creaking public health service to a long-running cost of living crisis.

If Labour wins, it will also inherit the worst economic situation of any incoming government since World War Two, its finance policy chief, Rachel Reeves, has said.

Starmer has run the party with discipline, not allowing any lawmaker to make uncosted pledges despite moves by the Conservatives to steal some of their policies, including revenue-raising measures Labour planned to finance the National Health Service and green projects.

He has ditched some of the pledges he made during the leadership campaign, such as the renationalisation of public utilities, instead turning to private business to appeal for help with rescuing a stagnating economy.

Starmer is already banking on two terms - a period of up to 10 years - to boost economic growth and increase tax receipts so Labour can help a public sector he says has been starved by years of Conservative austerity.

Named after the founder of the Labour Party, Keir Hardie, Starmer was brought up in a left-wing household in the southern county of Surrey. He studied law at the University of Leeds, in northern England, before doing postgraduate studies at Oxford University.

As a barrister, he specialised in human rights and rose to become Director of Public Prosecutions, earning a knighthood in 2014.

A member of parliament since 2015, he served as Labour's spokesperson for immigration and on exiting the European Union before being elected party leader five years later.

"Really, he is just a normal bloke, albeit with a ruthless streak," the Labour lawmaker said.

(Reporting by Elizabeth Piper; Editing by Alex Richardson)

By Elizabeth Piper and Andrew MacAskill