Gillard, 51, survived what amounted to a feint by former Labor Prime Minister Kevin Rudd.
With 10 minutes to go before a Labor Party caucus meeting and leadership vote, Rudd decided against a challenge, a report by The Age newspaper said.
Rudd, who was replaced as prime minister by Gillard in a 2010 leadership challenge, backed from his own challenge, saying by not running he was honoring a previous commitment.
The only circumstance in which he would challenge for the leadership would be if he had the backing of a significant majority of party members and the position of prime minister was vacant.
''I take my word seriously," The Age quoted him as saying.
''I'm here to inform you that these circumstances don't exist and therefore ... I will be adhering absolutely to the commitment I gave to the Australian people and my parliamentary colleagues,'' he said.
Gillard, who subsequently was elected unopposed as prime minister by caucus members, said "the whole business is completely at an end" and she accepted her re-election with ''a sense of deep humility and a sense of resolve," The Age reported.
''I never sought office for its own sake. I have sought office only in the interests of our nation,'' she said. ''We've got a lot of work to do and we'll continue to do it.''
This is the second time that Gillard has defended her leadership against Rudd who won a 2007 national election.
After winning in 2007, Rudd's popularity swiftly declined, thanks to dithering over implementation and finally dropping a proposed environmental carbon emissions trading scheme for industry.
There followed a brutal backlash over a proposed super tax on profits of Australia's aggressive and internationally successful mining sector.
Gillard -- who was Rudd's deputy prime minister -- mounted a successful leadership challenge in June 2010, becoming Australia's first woman prime minister. Gillard called a snap national election for August 2010 in which she beat the coalition of Tony Abbott's Liberal Party and the smaller National Party.
But it was the first hung Parliament since 1940 and Gillard formed a minority government only with the support of one Green MP and three independent members of Parliament.
In a conciliatory move, Gillard installed Rudd in her Cabinet as foreign minister but he resigned in February 2012 and called for a labor leadership vote, which he lost in a 71-31 vote.
The biggest winner n this week's botched Labor leadership challenge could be the official opposition Liberal Party, an analysis by the BBC said.
Polls continually suggest Rudd is more popular with the public than Gillard and Labor will suffer a major defeat at the Sept. 14 election, the BBC said.
Liberal Party opposition leader Abbott, 55, was quick to capitalize on Labor's leadership vote, The Age report said.
''The (Labor) civil war will continue as long as Kevin Rudd and Julia Gillard are in Parliament,'' Abbott said.
''I want to say to the Australian people that you deserve a government focused on you, not on itself. You deserve a government which is focused on the national interest, not on its own survival,'' he said.
"If the prime minister was concerned about the party, if she was concerned about the country, if she was less concerned about herself and her own survival, there would be an election now.''
Christine Milne, leader of Labor's governing coalition partner the Green Party, said Labor's internal divisions boosted the fortunes of Abbott and his Liberal Party.
"Today the Labor factions gave Tony Abbott a major leg-up, threatening the future of progressive reforms ..."
Gillard remained defiant that Labor will triumph in September's election, a report by The Telegraph newspaper in Sydney said.
''And let me say very clearly to the leader of the opposition," she said. "It will be a contest counterintuitive to those believing in gender stereotypes but a contest between a strong feisty woman and a policy weak man and I'll win it."
Jessica Simpson shares three-way kiss with friends in photo
Teacher apologizes for showing sexual image of herself in class