Julia Gillard will be a good leader ‘so long as she doesn’t turn into Maggie Thatcher’. Photograph: Scott Barbour/Getty Images

When she was young, she played with her big sister in the lane behind the family's two-up-two-down in Barry, the Welsh seaside town best known as a setting for the BBC comedy drama Gavin and Stacey.

Now after a brush with death, family partings and a fresh start on the other side of the world, Julia Gillard has become one of the most powerful female politicians.

In an extraordinary day in Australian politics, she became the country's first woman prime minister after Kevin Rudd stepped down as Labor party leader, avoiding a ballot he was certain to lose.

Rudd sounded out the backbench level of support for himself and Gillard, who had been publicly and privately loyal. She regarded his action as a sign he did not trust her assurances that she would not stand. It led to a push, and Rudd stood aside, aware he did not have the numbers.

As she began work, friends, family and neighbours in Barry were trying to work out how "little Julia" had got so far.

"It's strange to think someone you know getting a position like that," said the family's old next door neighbour Basil Baker. "I thought she'd do well in life. I didn't think she'd do that well."

Her aunt Mildred said. "She's achieved so much. I think she will be a fantastic prime minister because she was always a caring, decent person."

It has been an amazing journey. Gillard was born to a working class family in September 1961. Her father, John, was one of seven children, and worked as a policeman and clerk. He passed his 11-plus but his family could not afford to let him go to grammar school. Her mother, Moira, was a civilian worker at the police station.

It was a political family with John Gillard a familiar figure at Labour meetings and rallies. Gillard cites Nye Bevan, the architect of the NHS, as a key influence.

However, at three she almost died of bronchial pneumonia. Her aunt, Mildred Girling, 82, said: "We thought we were going to lose her. She spent a time in hospital and she was ever so frail. John and Moira asked the doctors how they could make sure she got better."

They recommended the family leave damp south Wales for Australia. So, aged four, Gillard and her parents and sister Alison left. Aunt Mildred said: "On the morning they left, Eric [Gillard's uncle] and I walked down to the station with them, helping them carry their suitcases.

"We had a little cry on the platform. They wrote when they arrived and said little Julia was heartbroken because she'd dropped her adored teddy bear over the side of the ship. She was inconsolable months later. I remember her clutching her bear when she left. She'd had it in the hospital and I suppose Julia and that bear had been through a lot together."

The family were among the thousands of "Ten pound poms" who emigrated to Australia in the 1960s. They had intended to settle in Melbourne but a couple from Wales recommended Adelaide.

She had a happy childhood and at high school, Gillard was a high achiever. When she was about 16 the family came back to south Wales to visit and stayed with next door neighbour Basil Baker.

"I remember Julia saying it was the first time she had seen snow," said Baker, 91. Julia enjoyed huddling in front of the electric fire. "We had a good yarn about the docks and the coal industry."

One day Baker asked her if she wanted to get married and start a family. "Quick as a flash, she said: 'Oh, I don't want to do that. I want a career and I want to get to the top. I've no time for marriage and kids'."

Back in Australia Gillard studied law and worked for a legal firm before moving into politics, identifying herself as member of Labor's left wing from the start.

When she entered parliament in 1998, Gillard was mocked for her nasal voice, her hairstyle, her poor dress sense and her failure to embrace domestic life. She lives with her partner of four years, hairdresser Tim Mathieson but has been criticised for not marrying or having children.

Gillard remained defiant when sworn in as prime minister: "I'm the first woman to sit in this role but I didn't set out to crash my head against any glass ceilings."

At their retirement village in Adelaide, Gillard's parents were coming to terms with fame. "We came here with modest aspirations, to work hard and educate my daughters," said Mr Gillard, 81.

Mrs Gillard said her daughter would be "the best [prime minister] there is", adding: "So long as she doesn't turn into Maggie Thatcher."