The five-day standoff over a young Soviet soldier who took refuge in the U.S. Embassy in Kabul, Afghanistan, ended yesterday after the Soviet ambassador promised that he would not be punished and the soldier left voluntarily, the State Department announced.

Department spokesman Charles Redman released a detailed account that said the soldier, identified as Alexander Sukhanov, 19, a private, signed a statement in Russian declaring that he had made his decision "of his own free will and wants to go home."

The account provided a day-by-day description of the steps taken by U.S. personnel since Thursday, when Sukhanov, a guard at Radio Afghanistan next to the embassy, entered the U.S. compound and declared that he "was unhappy with a soldier's life in Afghanistan."

The department's account did not mention the tensions caused by subsequent Soviet and Afghan efforts to force the soldier's return. However, U.S. officials accompanying Secretary of State George P. Shultz on his trip to Moscow said that at least five protests had been lodged before yesterday over the Soviet and Afghan actions in surrounding the embassy with troops, cutting off its electricity and training searchlights on the compound.

According to the account, acting U.S. Ambassador Edward Hurwitz directed that Sukhanov be told "that he would not, under any circumstances, be forcibly expelled from the embassy grounds or returned to Soviet custody against his will."

Sukhanov initially was unwilling to accede to requests from Soviet Ambassador Fikryat Tabeyev for a meeting. However, on Sunday the soldier reconsidered, and the meeting took place that afternoon "under ground rules established by the United States," according to the State Department. These rules specified a meeting in the embassy chaired by Hurwitz, who speaks Russian, and "conducted in a nonintimidating atmosphere."

Tabeyev expressed hope that Sukhanov would return to Soviet custody, but the soldier asked for more time to think. A second meeting was arranged for yesterday under the same rules.

At that meeting, the account continued, Sukhanov said he wanted to return to the Soviet Union. Hurwitz assured him that the United States would continue to provide refuge, and, if he wished, "we would make every effort to get him into the United States in asylum status," according to the department.

That was an apparent departure from standard U.S. policy, which normally does not permit foreign citizens to claim asylum in American embassies. Asked why the department had taken a different position in this instance, Redman replied, "I can say nothing more than that the statement speaks for itself."

After Sukhanov reiterated his decision to return, Hurwitz reviewed Soviet assurances that the soldier had committed no crime, would not be prosecuted or subjected to punishment and would be returned to the Soviet Union.

Tabeyev "stated that these were indeed his assurances," but the ambassador added that he could not rule out the possibility that Sukhanov might be reprimanded by the communist youth organization, Komsomol.

Hurwitz "told the ambassador that we would make public these assurances and that we would look to the Soviet Union to honor them," according to the State Department account.

The soldier then signed the statement declaring that he was leaving "freely, without restraint." After thanking embassy officials for their help, he left with the Soviet ambassador, the account concluded.