On the evening of last Aug. 12, Deputy Treasury Secretary R.T. McNamar received an unsettling telephone call from Mexican Finance Minister Jesus Silva Herzog. The Mexican official said there were "a number of problems" he needed to discuss, and that he and a group of aides would fly to Washington the next day to present them.

That Thursday night telephone call and the meeting at Treasury the next afternoon triggered a nearly nonstop round of bargaining that has become famous among Washington policy makers as "the Mexican weekend." By 11:30 Sunday night, the U.S. Treasury had agreed to pump nearly $3 billion into Mexico's depleted coffers to stave off a default on that country's debts and other international obligations.

And some observers now think the events of that weekend were a turning point in the Reagan administration's attitude toward support for the troubled world economy. Together with a similar crisis requiring an emergency $1.2 billion loan to Brazil two months later and the threat of other crises elsewhere in the world, Mexico's troubles made a deep impression on the administration.

President Reagan and his aides came into office dedicated to the "magic of the marketplace" as a cure for troubled economies and deeply suspicious of international financial institutions and the aid they dispense.

Now, says Sen. Charles McC. Mathias (R-Md.), who was a critic of those original policies, "I give them credit . . . . They've abandoned the mind set and are dealing with the real world."

Since "the Mexican weekend" in mid-August, the Reagan administration has set in motion a major commitment of new billions for the International Monetary Fund (IMF) and the creation of a special borrowing fund to tide over debt-burdened nations whose woes seriously threaten global stability.

In a trip to South America in December, Reagan announced the previously secret Brazilian loans and spoke of his strong support of the IMF at nearly every stop. Last week Reagan in his State of the Union address called for "adequate resources" for the IMF to restore the health of the global economy.

As this nation and nearly all of the rest of the world suffer from the longest-lasting slump since the 1930s, it is increasingly evident that economic trouble from abroad is a real and present danger on the order of, if not surpassing, the military hazards around the world.

Without much notice in recent years, the U.S. economy has become much dependent on overseas developments and markets. Today about 20 percent of U.S. industrial output is for export, involving one of every six U.S. production workers. Two of every five acres of U.S. farmland produce for export. About one-third of U.S. corporate profits come from international activities.

Moreover, U.S. commercial banks are heavily committed to overseas lending, with about $130 billion loaned to developing nations and the communist bloc. Going well beyond the giant banks in the New York and California financial centers, the lending to Latin America alone involves 1,500 banks in every corner of the country.

It is a reflection of America's stake in the world economy that, despite the general financial stringency, the administration is preparing to ask Congress within the next two months to authorize $7 billion to $10 billion dollars for the IMF capital increase and special emergency fund, plus nearly $5 billion in new capital for the Inter-American Development Bank, more than $1 billion for the Asian Development Bank and $150 million for the African Development Bank.

Because the United States will receive international assets in return or because the dollars are applied as guarantees, these funds will not show up as charges against the federal budget even though Congress is required to approve the commitments. Policy makers are well aware that the climate in Congress will be chilly, but they already have begun to make their case.

"The world faces extremely difficult economic and financial problems, essentially without precedent in the postwar period," Secretary of the Treasury Donald T. Regan told the House Banking Committee late in December in testimony on the additional funds for the IMF. "Mismanagement of these problems would have serious adverse effects on the United States economy."

In an interview, Regan argued that the Mexican crisis and other events of the past six months did not require or produce a turnabout on the part of the Reagan administration. "As far as the Treasury is concerned, there was no shift in policy," he said, declaring that the growing global financial problems and the need to support international lending institutions were recognized early in the administration.

Mathias, chairman of the Senate Foreign Relations subcommittee on international economic policy, took a different view. Mexico's plight and the events and threats that followed, according to Mathias, demonstrated to the administration that "the problems were bigger than both of us."

Robert D. Hormats, who served as assistant secretary of state for economic and business affairs in the first 20 months of the administration, said the policy on the international economy evolved in stages since a celebrated battle between Office of Management and Budget Director David A. Stockman and then-Secretary of State Alexander M. Haig Jr. In the course of this evolution the Treasury became much more energetic and effective in supporting major new funds to aid the global economy, he said.

The Mexican events had "a major effect," according to Hormats. "Everybody began to realize this is a very serious situation" which could have impact on the world financial situation, the world trading situation and the U.S. economy, he said.

A senior State Department official with responsibilities in the economic field had still another interpretation. "I don't think the policy has changed so much as the facts around the world have changed," he said. The result of changing circumstances, in his view, is that support for the IMF on a limited basis became much more expansive support as needs accelerated.

As recounted by Regan, concern about the Mexican economy goes back at least to the North-South summit meeting at Cancun in October, 1981. He said he had discussions with Mexican officials about "their growing inflation, their incurring large amounts of debt."

Regan said he discussed the problem again with Mexican Finance Minister Silva Herzog during a meeting at Helsinki, Finland, last May. Regan recalls saying that "he should keep us posted very closely on what was happening in his country, because we were getting worried." There was a still another meeting of the U.S. and Mexican finance ministers in Washington July 23, at which the Mexican officials acknowledged difficulties but expressed belief they could be surmounted.

Another senior U.S. aide said it had been known since early last year that Mexico was in big trouble, but that the Mexicans were reluctant to discuss it with outsiders because of the impending national elections. "By April they began recognizing that the jig was up and began talking to us," the official said.

On Aug. 12, the day of Silva Herzog's call to McNamar, the Mexicans were forced to stop exchanging pesos for dollars. The suspension of foreign exchange, coming on top of a series of economic reverses, set off an alarm in financial circles.

At the Washington meeting the following day, according to Regan, the Mexican finance minister "put on the table the fact that they were in dire straits. They would need some type of immediate rescue in the way of dollars to help them meet their financial obligations." It quickly became clear that Mexico would need around $3 billion right away to meet payments while it sought to renegotiate its debt payments with private commercial banks and negotiate an austerity program and borrowing agreement with the IMF.

At this point and all through the weekend the discussions were secret, but the extent of Mexico's trouble was distinctly unpleasant news to the select group of U.S. officials that was informed. With outstanding foreign debt of $8l billion, of which about $25 billion was owed to U.S. commercial banks, Mexico was the largest debtor of the developing world. Its failure to pay would send a jarring and even dangerous shock throughout the global financial system. Moreover, it was right next door, insuring that its financial woes would quickly be felt in this country in human as well as economic ways.

According to an estimate of Prudential-Bache Securities, six giant U.S. commercial banks had more than $1 billion each in loans to Mexico last fall: Citicorp, $2.8 billion; Bank of America, $2.5 billion; Manufacturers Hanover, $1.9 billion; Chase Manhattan, $1.6 billion; Chemical, $1.4 billion, and J.P. Morgan, $1.1 billion.

While the Mexican visitors went back to their hotel rooms, Regan called in Paul A. Volcker, chairman of the Federal Reserve Bank. Treasury and Fed experts mulled over the problem. Regan, acting under existing authority, quickly authorized transfer of $1 billion to Mexico from the Treasury's Exchange Stabilization Fund, which was originally set up to support the U.S. dollar abroad.

Meetings at Treasury under Deputy Secretary McNamar lasted late into Friday night. Saturday morning the main lines of an emergency plan emerged: the prepayment of $1 billion by the U.S. Energy Department for additional Mexican oil for the strategic petroleum reserve, and $1 billion in U.S. farm export credit from the Commodity Credit Corp. The latter was set in motion when Agriculture Secretary John R. Block telephoned McNamar with an invitation to go jogging. "It was the billion-dollar jog . . . the most expensive run discussed in history," McNamar said later.

To assist in the oil negotiations, the Mexicans flew their energy minister, the head of the national oil company, and petroleum experts to Washington. Meanwhile, key officials and experts were summoned from the White House, Office of Management and Budget, Treasury, Federal Reserve, Controller of the Currency, State, Energy and Agriculture departments.

With the Mexicans joining in, sometimes at the same table, sometimes in separate huddles, meetings continued from 7 p.m. Saturday to 4 a.m. Sunday, and from 9 a.m. Sunday until 11:30 that night when agreement was reached. As part of the deal, the Mexicans agreed to the main lines of an austerity program to be negotiated formally with the IMF.

"These were intense discussions for big stakes," recalled one participant. "It was a very tense weekend," recalled another. Regan said the work done in the Mexican weekend would take about three months in the commercial world. "We're talking about billions of dollars here, and you don't construct a deal like that overnight or even in a few hours."

McNamar, who was in immediate command of the negotiations, said he did not hear from any commercial banker during that weekend and he believes they were unaware of the closely held discussions taking place. A few days later, though, representatives of more than 100 banks from around the world were called to a meeting at the Federal Reserve Bank of New York where Silva Herzog asked for and eventually obtained a 90-day postponement of $10 billion in payments due.

Still later the IMF's managing director, Jacques de Larosiere, reportedly pressured the commercial banks to loan an additional $5 billion to Mexico, saying that the international agency would back out of the rescue effort unless they did so. The banks complied.

Mexico's plight quickly sapped the ardor of the banks for other loans in Latin America and the third world generally, generating fears of a climate in which many additional debtors would be in trouble. At the IMF meeting in Toronto early last September rumors flew about a host of countries, including Brazil and Argentina. "The bankers were extraordinarily nervous," recalled a White House official.

It was in this context that Regan unveiled the U.S. plan for a special emergency fund and U.S. agreement to a modest increase in the IMF capital. Regan said the ideas had been informally discussed over the summer, before the Mexican crisis.

Other countries had called for many months for a larger increase in funds for the IMF, and it was widely reported that the reticent Americans were the main holdout and stumbling block. Treasury officials now maintain that this stance was largely for bargaining purposes, in order to hold the IMF fund increase to a sum which has a chance of approval by Congress.

A Federal Reserve official said, however, that even by the time of the Toronto meeting, "the administration was obviously not together" on any position. Treasury and State were moving toward greater support, he said, but the White House was not sold on the program until after the Toronto meeting.

Regan said that at Toronto in September the United States also suggested advancing the date for the increase in IMF funds by two years, from the end of 1985 to the end of 1983. Because of the increased demand for help from troubled debtors, it is "quite possible" that IMF ability to commit new money to adjustment programs could be exhausted during this year in the absence of more funds, according to the treasury secretary.

Several officials said the rapid succession of emergencies, beginning with the Mexican weekend in August and continuing most vividly in negotiations about emergency loans to Brazil in early October, were key elements in a reasssessment of the the global financial situation and the U.S. role in it.

McNamar, while denying that there has been a basic policy shift, said, "What the Mexican situation did was to focus the attention of bankers, the press and governments at higher levels, on the financial situation." He added, "That crystallized our thinking that we should have an increase in IMF funds sooner rather than later."

Staff writer Caroline Atkinson contributed to this report.