In the first formal U.S.-Soviet encounter on Afghanistan in three years, the United States asked the Soviet Union to devise a political solution and make plans to withdraw its 115,000 troops from the country, a State Department source said.

U.S. and Soviet diplomats discussed the Afghanistan war here Tuesday and Wednesday.

The talks focused on a possible political solution to the war, a U.S. diplomat said. "Both sides basically outlined their past positions. No extreme positions were taken and there were no surprises," he said.

"Our position was that within the context of the U.N. talks the Soviets have to offer a timetable for withdrawal," a State Department official said. A new round of U.N.-sponsored talks on the 5 1/2-year Afghan war, involving senior officials from Pakistan and Afghanistan, opened in Geneva yesterday.

The possibility of a shift in the Soviet approach to Afghanistan under Mikhail Gorbachev has led the United States to revive its push for a political solution. In discussions in Moscow between Gorbachev and Italian President Benito Craxi late last month, Gorbachev is reported to have repeated the need for "a political solution" to the war.

Although department officials said that they did not detect a new Soviet urgency to resolve the situation, one official said that "intriguing hints" have been dropped that the Soviets are reflecting on the circumstances of the war.

"The Soviets," a department official said, "repeated their position" at the talks. The Soviet Union has long demanded an end to "outside interference" in Afghanistan, referring to assistance given to Moslem rebels by the United States, Pakistan and other Islamic countries. Recently, they have also stressed the need to find a "political solution" to the conflict.

State Department officials described the U.S.-Soviet discussion as "frank and businesslike," but declined to describe the substance of it. "The talks were not negotiations," one official said. "The place to look for movement is Geneva." The current round of indirect talks in Geneva, conducted by U.N. Undersecretay General Diego Cordovez, was arranged after Cordovez visited Pakistan and Afghanistan last month. The talks are expected to last a week.

The meeting on Afghanistan was the third in a series of talks on regional conflicts between U.S. and Soviet diplomats this year, and the first formal encounter between Moscow and Washington on the Afghan war since July 1982, when officials met in Moscow.

The U.S. delegation was headed by Richard W. Murphy, assistant secretary for Near Eastern and South Asian affairs. The Soviet Union was represented by a four-man delegation, including Yuli Alekseyev, chief of the Middle Eastdepartment in the Soviet Ministry for Foreign Affairs, and Oleg Sokolov, No. 2 in the Soviet Embassy.

"Our incentive for taking part in the meeting is that we would like to see the war come to an end," a State Department official said.

Soviet troops invaded Afghanistan in December 1979. Soviet air violations across the Afghanistan border into Pakistan, which escalated last August, are continuing, a U.S. official said. An estimated 3 million Afghan natives have sought refuge in Pakistan.