The Reagan administration is moving toward approval of an East-West compromise that would bring final success to the long-running Madrid conference on European detente, official sources said yesterday.

The sources said Secretary of State George P. Shultz has recommended approval of the compromise negotiated at Madrid, on condition that the Soviet Union provide expected assurances on three points previously advanced by western governments.

Shultz is reported to be ready to go to Madrid to deliver a final public statement for the United States that would cap successful negotiations on the follow-up to the 1975 Helsinki accords. He also would use the occasion to meet with Soviet Foreign Minister Andrei A. Gromyko, who is expected to make a final statement for his government.

The date for such a ceremonial public session of the foreign ministers of the 35 countries involved has not been established, the sources said.

Max M. Kampelman, U.S. ambassador to the Madrid talks, met Shultz yesterday to discuss the last unresolved issues, the sources said. Kampelman is expected to return to Madrid tonight following a meeting with President Reagan.

The only remaining questions, the sources said, are about a proposed 1986 international conference on "human contacts," such as emigration and family reunification. After balking for many months, the Soviets recently agreed to authorize such a conference as part of the follow-up to the Helsinki accords.

The United States and other western nations are reported to be asking three assurances from the Soviets regarding the human contacts meeting: that it not be conditional on the state of East-West relations at the time; that the session be on a par with other Helsinki follow-up meetings; and that the "chairman's statement" authorizing the human contacts session be published as an official document of the Madrid meetings.

Kampelman reported to Shultz that he has every reason to believe that the Soviets will provide these assurances, the sources said. If this is done promptly, the Madrid conference may be able to wind up its working sessions with a unanimously approved result as early as next week.

A concluding ceremony to hear public statements by the foreign ministers is likely to follow the last of the working sessions. This ceremonial meeting is not likely before the end of this month, and possibly might be delayed until early September, according to U.S. sources.

Last-minute progress in the Madrid conference, which has been under way almost three years, resulted from a variety of international political maneuvers. They include proposals by European neutral nations, a Spanish compromise plan that was accepted by the West, and the sudden acceptance of the Spanish plan by the Soviets in a reversal of some previous positions.

Spanish delegate Juan Luis Pan de Soraluce, who has been at the center of the last-minute tradeoffs, told Washington Post special correspondent Tom Burns that the breakthrough occurred when Soviet delegate Anatoli Kovaliov returned to Madrid early this month.

"Suddenly there was a Soviet rush to end the meeting," Pan de Soraluce said. He added: "They the Soviets want to finish in Madrid and they want to finish now. They have had to make concessions."

Burns quoted a senior western diplomat as saying that Moscow's switch highlighted a Soviet need to demonstrate that detente still exists. The diplomat also said that Moscow gives high priority to the staging of a European disarmament conference that would be held next January in Stockholm under the compromise Madrid agreement.