LONDON (AP) — Gordon Brown's career is a reminder of the adage about being careful what you wish for.

He served for a decade as Britain's Treasury chief, but longed to be prime minister. When he finally got the job, he faced economic crisis, a divided party, public disgust with politicians — and the likelihood of being booted out of office by voters on Thursday.

The son of a Church of Scotland minister, whom he says instilled Presbyterian values of prudence and charity, Brown was intellectually and politically precocious. Canvassing for the Labour Party by the age of 12, he entered the prestigious Edinburgh University at 16 and was a leading political activist in Scotland by his 20s.

During a visit to a London church this week, Brown joked about his father's political influence.

"When the Labour Party won, the first song on Sunday would be, 'Now Thank We All Our God,'" Brown said. "But if they lost, the first hymn on Sunday would be 'Dear Lord and Father of Mankind, Forgive Our Foolish Ways.'"

Brown's supporters say his early years forged his political strengths — tenacity, courage, a commitment to social justice and a lifelong loyalty to the Labour Party.

Brown, now 59, lost the sight in one eye in a rugby accident when he was a teenager, and underwent surgery to save partial vision in the other. He has said the experience cemented his support for Britain's National Health Service.

After time lecturing, working in television and making a name for himself in the Scottish Labour Party, Brown was elected to Parliament in 1983 and began his rise through party ranks.

He was tipped by many to become leader when Labour chief John Smith died unexpectedly in 1994. But instead it was Tony Blair who took the helm, sweeping Labour back to power in 1997 with Brown as his right-hand man.

The two men had contrasting styles — Blair smooth and affable, Brown rumpled and brooding — and stories often emerged of conflict between the next-door neighbors in Downing Street.

As chancellor of the exchequer, Brown was credited with leading Britain through a period of unprecedented prosperity. He finally got his wish to lead Britain when Blair stepped down in 2007 — just as that decade of stability was being replaced by global economic turmoil.

Despite bold moves to confront the crisis, for which won Brown international praise, unemployment rose, banks teetered on the verge of collapse and Labour's popularity sank. Labour politicians began to grumble that Brown was a liability.

Then came further disaster: leaked details about lawmakers' expense claims revealed legislators had billed the public purse for everything from flat-screen TVs to moat-cleaning and a floating duck house. All major parties were implicated, but public disgust with politicians hit the Labour government hardest.

Throughout the election campaign, Brown's party has trailed second or even third in opinion polls.

The man once memorably described by Conservative leader David Cameron as "an analogue prime minister in a digital age" has struggled to shine in the first election to feature televised leaders' debates.

Brown has implored voters to focus on his substance, not his style.

"My parents taught me the fundamental values of taking responsibility, doing your duty, being honest, looking out for others," he said during a speech in the final days of the campaign. "That is the right way, it is your way, and it is my way."

It won him hearty applause, but it may not be enough.