Former British prime minister Tony Blair has told a press ethics inquiry that he got too close to Rupert Murdoch's media empire.

Tony Blair said it was inevitable that top politicians and media executives had a close interaction, as he defended the way he courted Mr Murdoch before and during his time in office from 1997 to 2007.

The hearing was interrupted briefly by a heckler who accused the former prime minister of being a war criminal for supporting the US invasion of Iraq.

Mr Blair said he had made a strategic decision not to take on the power of the press during that time, despite calls for tougher media regulation following the death of Diana, Princess of Wales in 1997.

Had he done so, he said, the "absolute major confrontation" required would come at the price of shelving his programme for office, which he felt was a bigger priority.

He said the consequence of falling out with media chiefs would have been an all-out, lifelong, ferocious attack.

The former prime minister said the chief problem with the British press was the blurring of boundaries between news and comment in some papers, where reporting is twisted into an "instrument of political power".

He said the crossover had turned into a "very violent and aggressive" genre of attack.

Asked whether he had got too close to Mr Murdoch's British publishing arm News International, Tony Blair replied: "Yes."

But he added: "I don't know a policy that we changed as a result of Rupert Murdoch."

Then-opposition leader Tony Blair flew to Australia to meet Mr Murdoch in 1995, with the "very deliberate and strategic" aim of persuading his News Corporation empire against "tearing us to pieces".

Tony Blair faced questions about claims of back-room deals with Mr Murdoch on policies such as maintaining restrictions on trade unions and rejecting tougher media ownership rules.

He said there was no deal in exchange for Mr Murdoch's support, saying the media baron "never made such an approach to me".

He said he "understood why these conspiracy theories arise" but added: "Our views may have coincided but I believed in what I was doing. I didn't need anybody else to tell me what to do."

In three phone calls with Mr Murdoch in March 2003 ahead of the US-led invasion of Iraq, Tony Blair said he would simply have been explaining his viewpoint.

"I wouldn't say there's anything particularly unusual or odd about that when you're facing such a huge issue," the 59-year-old said.

"I would describe my relationship with him as a working relationship, until after I left office.

"It was a relationship about power.

"These relationships are not personal, they are working, to me."

On being godfather to ten-year-old Grace Murdoch, the second youngest of Mr Murdoch's six children, Mr Blair said his relationship with Rupert Murdoch changed after he left power.

"I would never have become godfather to his child on the basis of my relationship with him in office," he said.

Tony Blair also admitted a friendship with Mr Murdoch's former close aide Rebekah Brooks.

Ms Brooks has been charged with conspiracy to pervert the course of justice over the phone-hacking scandal at Rupert Murdoch's now-closed News of the World tabloid.

The Leveson Inquiry was set-up by current Prime Minister David Cameron in July 2011 as the phone-hacking scandal escalated, and is currently examining the links between politicians and the media.