President Chun Doo Hwan announced the lifting of martial law today, returning police powers to South Korean civil authorities for the first time in 15 months. He acted a day after sparing the life of convicted opposition leader Kim Dae Jung.

Both decisions by Chun followed the announcement in Washington Wednesday that the former general will visit President Reagan on Feb. 2 as part of an official visit to Washington. Clemency for Kim was thought to bea condition for the invitation to Washington.

In announcing that military rule would end at midnight tonight, Chun said, "The dangerous situation of the nation" is over and "the foundation of social stability has been fully restored." He had promised to lift martial law before next month's presidential election and had strengthened police powers to deal with unrest in anticipation.

Nevertheless, the announcement was regarded here as a significant liberalization prior to his U.S. visit.The order means military censorship of the press is lifted and civilian courts will take over cases that were handled by military tribunals.

Under new civilian laws, however, police are authorized to enter campuses. And the government will still exert general influence over what newspapers print.

With the burden of Kim Dae Jung temporarily off his shoulders and a White House invitation in his pocket, observers here suggest Chun can look forward to more support at home and a period of eased tensions with the United States.

Officials of neither the U.S. nor South Korean governments would discuss what arrangements had been explicitly made in the Kim case, but diplomats observed that Chun knew his relations with a Reagan White House would be difficult if he had let Kim die.

"It is very unlikely that Chun would have been invited unless the question of leniency [for Kim] had been settled," said one diplomatic source.

[In Washington, State Department spokesman William Dyess said Chun's decision would "contribute positively" to relations between the United States and South Korea. "It improves the atmosphere," he said. Dyess refused to comment on the timing of the decision or on whether the Reagan administration would pursue the case any further.]

It appears doubtful that the Kim Dae Jung case is settled for good, however. He still faces life imprisonment on what many Westerners and South Koreans regard as trumped-up sedition charges, and he is still a popular figure here, despite or because of his years in prison and under house arrest.

Nevertheless, the prize Chun won by salvaging Kim's life was a big one, diplomats acknowledged today. A political necessity for any South Korean leader is a friendly hearing in the United States, which still stations 39,000 troops here as insurance against a communist invasion.Chun will run for a full seven-year term next month and, although he faces only nominal opposition, he is said to want genuine vote of approval.

Chun is the first South Korean president to be invited to the United States in 14 years. He is also among the first group of foreign leaders to meet Reagan, another plus for him. It appeals to South Koreans' nationalistic pride, said one diplomat, that "Chun gets in there ahead of the Japanese."

It is a chance to write on a new slate for the former Army general whose rise to power since December 1979 was strongly opposed by the Carter administration, which he had defied by unilaterally calling South Korean forces away from the joint South Korean-U.S. command to support a coup in the military.

His government clearly expects relations to be better with the new U.S. administration, since Reagan has indicated that he will not stress human rights issues to the extent former president Jimmy Carter did. In late November, Chun began dispatching both civilian and military representatives to Washington to sound out Reagan advisers. It is believed that the first talks on a resolution of Kim Dae Jung's fate were made then.

From information available here, it appears that the outgoing Carter administration was largely bypassed and that negotiations were held with the Reagan advisers. The U.S. Embassy here did not know of the timing of the visit until it was announced in Washington and until then it did not know specifically that a state visit had been arranged, according to diplomatic sources.

Many here believe the insistence of both Carter and Reagan aides on saving Kim's life changed Chun's earlier inclinations and forced him to buck the sentiment among the small circle of his military colleagues who make most real policy decisions here.

Three months ago it was widely assumed in Seoul and Tokyo that Kim would be executed. He is despised by many leading generals and colonels as a noisy troublemaker who fought military rule here for a decade.

The manner in which the sentence was changed to life imprisonment suggests that there was some concern for trouble from within the military elite. The decision was made in the name of the Cabinet and only later was it made clear, through government spokesmen, that because Chun was present at the meeting, it represented his will. This conflicted with the general understanding that only the president could commute a death penalty.

It was also made to appear that Kim had petitioned for clemency and expressed repentance for endangering national security. His attorney said he knew of no such appeal.