Just two weeks ago, Bettino Craxi was as happy a man as an ambitious politician ever allows himself to be.

He was coasting toward a record as Italy's longest-running postwar prime minister. His political opposition, the Christian Democrats and the communists, offered no real challenge to his intelligence or force. He had reduced inflation, increased productivity and given his government a name for steady, rational leadership.

Craxi is taller than most Italians -- well over six feet -- and tougher than most -- his detractors caricature him as Mussolini. He relies on efficiency rather than charm to hold together the coalition that permits him to be his country's first socialist prime minister. If the Italians had the word "businesslike," they would apply it to him. They, and he, have been proud of his almost unprecedented crisis-free 22 months in office.

His ornate office in the Palazzo Chigi is dominated by an alabaster statue of Garibaldi, Italy's liberator. There, in an interview on Oct. 2, he was fulminating about the Israeli raid on Yasser Arafat's Tunisian headquarters. Craxi was indignant at President Reagan for "legalizing" the raid, furious at the sabotage of King Hussein's peace initiative, which was then being explored in the United States.

"And that is Israel's answer -- bombs," he said.

Today, of course, the Israeli bombs in Tunisia are almost forgotten. The chances for peace in the Middle East have gone overboard -- with the body of poor Leon Klinghoffer, the victim of the hijacking of the Achille Lauro. And Craxi is barely hanging onto his job.

Reagan, given his choice, might never have willingly caused such distress to Craxi. Although he is a socialist, Craxi is totally pragmatic, unassailably pro-Western. He was to be sure, the first NATO leader to go to Moscow to greet the new leader of the Soviet, but his country was also the first to accept U.S. missiles in Europe.

Craxi's government has given no trouble on East-West matters. Italy has no antinuclear movement and is so firmly bound to us by human and economic ties that Washington, in making its geopolitical and strategic calculations, tends to take Rome for granted.

Craxi longs for some sort of independence -- "our faithfulness, our loyalty should not be interpreted as blind belief and obedience," he says. He has tried to carve out a role for Italy, and himself, as a mediator between its favorite superpower and the Third World. Craxi said the United States would do well to consult Italy more.

He has been outspoken on the subject of Chile. In a Washington visit, he publicly called for the ouster of Gen. Agosto Pinochet, the tyrant who still enjoys American patronage. Recently, in Rome, he received Gabriel Valdes, the leader of an anti-Pinochet coalition.

Craxi is proud of the correct and enlightened conduct of the Italian peacekeeping forces in Lebanon, who took no sides and suffered no casualties. He has cultivated relations with Arafat and has steadfastly maintained that the PLO has a part in the Middle East peace process. Maybe his rationale was -- as he says of his ability to maintain a coalition government despite the minuscule size of the Socialist Party -- "a little for love, a little for necessity" -- Italy depends on the Arabs for 95 percent of its oil.

He spoke drily of Reagan's conduct of foreign affairs.

"I wouldn't do anything to bring communism to one country in the world. But not everything is a matter of communism versus anticommunism. The Palestinians are not communists; the coalitionists in Chile are not communists.

"I think if you see it only in those terms, you run the risk of having a McCarthyite foreign policy," he said. "We could help in these problems. Our posts may not always function a reference to Italy's erratic postal system , but our brains do."

Long before four gunmen seized the Achille Lauro, Craxi had been warning of a new wave of terrorism. Rome has had two bombings in the last month. It may have been a wish to avoid more that prompted him to free Mohammed Abbas, the PLO official who was on the plane grounded by U.S. F14s in Reagan's finest use of military power.

Craxi had sought a businesslike solution to a situation that had none. To Washington, it did not matter that the hijacking ended well "for the most part," as Craxi put it. Once Klinghoffer was murdered, the time for Craxi's specialty -- compromise -- was over.

His declaration of independence -- the release of Abbas in the face of U.S. fury -- has brought his government to the brink of collapse. And, for the moment anyway, ended his hopes of becoming a world statesman.