Rupert Murdoch, the Australian newspaper entrepreneur, has suffered his first major business defeat trying to buy Australia's biggest media corporation.

He offered $140 million for 50 percent of the Herald and Weekly Times Limited but was beaten in the biggest takeover battle ever seen here.

At the peak of the three-day fight, Murdoch managed to get about 5 percent of the Herald's 64 million shares. And he got a handsome second prize of nearly $4 million profit by unloading them when he realized the Herald management, associated companies and other Australian interests opposing his bid had won the battle.

John Fairfax Ltd., publishers of the Sydney Morning Herald, last month acquired a 14.9 percent share in the Herald group for about $55 million. Associated newspaper companies controlled by the Herald own nearly 25 percent of the group. That 40 percent total effectively shut Murdoch out. The rest of the stock is scattered among 25,000 small shareholders.

It was a poignant defeat for the international publisher who, however, dismissed the shutout, declaring: "The alliance is of two incompetent managements throwing themselves into each other's arms at the expense of their shareholders."

Australis is where Murdoch began to build his empire a quarter century ago and where his company, News Ltd., still has its base.

More significantly, the group he bid for and its flagship newspaper, the Melbourne Herald, were the creation of his father and the newspaper home after which he has hankered all his life.

The late Sir Keith Murdoch had turned the Melbourne Herald into one of the world's most successful afternoon newspapers.

On its journalistic success and considerable profits, the elder Murdoch built an empire throughout Australia that now includes a dozen daily newspapers, four Canberra television stations, a score of radio stations, numerous magazines, newsprint factories and major newspaper interests in Papua New Guinea, Fiji and Singapore.

But unlike his son, Murdoch was a manager, not an entrepreneur.

When he died in 1952, Murdoch had virtually no stock in the Melbourne Herald group, his own fortune being largely tied up in the Adelaide News.

Rupert Murdoch spent the rest of the 1950s learning the business at the Adelaide News and building his financial strength by TV and newspaper acquisitions.

In the 1960s, he expanded his empire to Britain and in the 1970s, he bought into the United States with newspapers in Texas and New York as well as the weekly National Star.

But there was never any doubt in Australia that one of his dreams was to win control of the Melbourne Herald and its group.

In the middle of last month's battle, Rupert's mother, Dame Elisabeth Murdoch, 70, said "It is lovely to feel that Rupert is in a position to attempt to regain his father's paper."

But the Herald and Weekly Times Ltd. chairman, Keith MacPherson rejected the proposition that Murdoch had a birthright to the company.

MacPherson was the key figure in Murdoch's defeat. Less than 24 hours after Murdoch made his bid of $4.40, a share for half the company stock, MacPherson announced a three-for-two bonus stock split and a 16 percent rise in profits to nearly $23 million for the latest fiscal year.

During the battle, the conservative government of Malcolm Fraser showed signs of nervousness.

Murdoch's papers strongly supported Fraser in the last two elections, which Fraser has won by land-slide margins.

But the government was chary of an outcome that would have placed 85 percent of the nation's daily newspapers in one man's hands along with many radio and TV stations.

The government did nothing to stop its Trade Practices Commission from demanding that Murdoch stop buying shares in the Herald for a month while it studied the implications of the takeover "immediately and urgently."

Meanwhile the Melbourne Herald itself vigorously opposed Murdoch's takeover bid.

Contrasting Murdoch with the Herald group, the paper said: "Mr Murdoch's newspapers always respond in unison -- as though to some unseen divine wind -- as they pursue their relentless campaigns in favor of current Murdoch objectives, particularly his political ones."

Opposition leader Bill Hayden condemned the takeover from the start and supported this move.

But his rival for leadership of the Labor Party, head of the Council of Trade Unions, Robert Hawke, was silent. Murdoch's papers have consistently promoted Hawke.