Media mogul Rupert Murdoch asked John Major when he was prime minister in 1997 to change government policy in return for the support of News Corporation, the Leveson inquiry has heard.

Major, giving evidence at the inquiry into press ethics, said Murdoch contacted him in the run-up to the 1997 general election and "made it clear that he disliked my European policies and asked me to change them".

"If not, his papers could not and would not support the Conservative government," Major added.

He said: "Both Mr Murdoch and I kept our word. I made no change in policy and Mr Murdoch's titles did indeed oppose the Conservative party. It came as no surprise to me when soon after our meeting the Sun newspaper announced its support for Labour."

Major, Conservative prime minister from 1990-97, told the inquiry, which is focusing on the close relationship between the press and politicians, that he had not discussed the conversation in detail since it took place and was only doing so now because he was under oath.

"It is not very often someone sits in front of a prime minister and says to a prime minister: 'I would like you to change your policy and if you don't change your policy my organisation cannot support you," he said.

Major's revelations again raise concerns over the levels of access to politicians that News Corp wields, seemingly adding weight to justice secretary Ken Clarke's warning that the press holds more political sway than the government.

Murdoch told the inquiry that former prime minister Gordon Brown claimed he would "wage war" on News Corp when the Labour party lost the Sun's allegiance in 2009.

On Monday, Brown denied Murdoch's recounting of events, claiming the only evidence was Murdoch's comments to the inquiry.

Major stressed the importance of the inquiry and the need to take action on its findings.

He said: "It's the politicians who are in the last chance saloon with the recommendations that this inquiry may make. If the recommendations are not enacted, then I don't see how this matter can be returned to in any reasonable period of time and those that have behaved badly - putting at a disadvantage those parties that did not - will continue to do so.

"[The inquiry needs] to eliminate the bad behaviour, which is a cancer in the journalistic body not the body as a whole. It is in the interests of the body of journalism as a whole that the inquiry is taken seriously."

He claimed that statutory enforcement should be put in place for the press, although it would have to take an active role in deciding the boundaries of enforcement. He also called for editors and proprietors to be held personally responsible for the content of their titles.

"They cannot just wash their hands of it in a Pontius Pilate manner," he said. "If there is a culture in journalism that is leading to these problems then it is the culture itself that needs to change."