The United States sold five times as much weaponry and military expertise to Saudi Arabia as to Israel in the fiscal year just ended, according to Pentagon figures obtained yesterday.

Although most of the $5.1 billion in military sales to Saudi Arabia went to construction of service academies and the like, rather than weapons, the record-high total does testify to a new relationship between the U.S. and Saudi military.

The Pentagon figures indicate the relationship came into flower shortly after the Arab oil embargo was imposed in late 1973. After the embargo was lifted, the Nixon administration promoted military sales to oil-rich countries as it sought ways to offset the higher cost of petroleum imports.

In fiscal 1973, which ended before the Arab oil embargo, Saudi Arabia spent $709 million on U.S. military equipment and services, Pentagon figures show.

Starting in fiscal 1974, the year of the oil embargo, U.S. military sales to Saudi Arabia jumped to $2 billion and kept climbing toward the $5 billion mark reached in fiscal 1979.

The U.S. Army Corps of Engineers is supervising construction of everything from the Saudi version of the Pentagon to a power plant as part of the $5 billion in military sales agreements for the fiscal year just ended.

Israel, by contrast, bought mostly weapons under its sales agreements with the United States, which totaled $902 million in fiscal 1979, with a possibility of some last-minute additions.

The Pentagon figures also dramatize the loss of one of the best customers for American arms. The shah of Iran bought $5.7 billion in U.S. weaponry in fiscal 1977, but Iran's new government purchased only $41.6 million this past fiscal year.

Although this represents a big loss of petrodollars for the United States, Irans's virtual halt of arms imports will help President Carter make good on his pledge to reduce arms exports.

Carter last year set a goal of $8.4 billion in arms sales to so-called "ceiling" countries, a list that includes every nation except those in NATO and Japan, New Zealand and Australia. Thanks largely to Iran, the Pentagon estimates that sales to "ceiling" countries will fall almost $2 billion under the president's goal.

However, this sudden loss of Iranian arms business has confronted the administration with the question of whether to set a fiscal 1980 ceiling below the $6.4 billion in sales expected for fiscal 1979. A lower ceiling would be difficult to achieve, according to administration officials.

Counting military sales to ceiling and nonceiling countries, the Pentagon estimates the total for fiscal 1979 will be $13 billion, or about $535 million less than last year and $1.5 billion less than originally predicted for fiscal 1979.

Israel ranked second behind Saudi Arabia, accounting for $902 million in firm sales agreements. Some additional sales in negotiation during the last days of bookkeeping for the fiscal year may push the Israeli total to $1 billion.

West Germany ranked third in total military sales and Taiwan fourth, according to the Pentagon's accounting for fiscal 1979.