The South Korean government, seeking to enhance its international image and consolidate its political power at home, today released imprisoned opposition politician Kim Dae Jung from confinement at a hospital in Seoul and allowed him to fly to the United States for medical treatment.

Kim arrived at Washington's National Airport at about 10 p.m. Thursday and thanked President Reagan and Senator Edward M. Kennedy (D-Mass.) for helping to secure his release.

The South Korean government freed more than 1,200 other prisoners before dawn Friday in a sweeping Christmas amnesty, including 48 dissidents who had been involved in anti-government protests, The Associated Press reported from Seoul.

Knowledgeable observers in Seoul and Tokyo said Kim's departure signaled virtual banishment for the country's best-known dissident. It capped a week of speculation about the fate of the 57-year-old former presidential candidate. He was transferred to Seoul National University hospital on Dec. 16 from prison, where he was serving a 20-year prison sentence on charges of sedition.

The move was the latest in a series of twists in a turbulent political odyssey in which Kim has spent much of the past decade in exile, in jail in South Korea, or under house arrest in Seoul.

Kim boarded a plane for Washington this evening after an ambulance whisked him to Seoul's Kimpo International Airport under tight security. While he was expected to travel to seek possible treatment in Washington, his family indicated his ailments were not serious.

Kim was not allowed to return to his home in Seoul or meet with friends or political supporters before his departure. He was accompanied by his wife, Lee Hee Ho, and two of their three sons.

The government said in an earlier announcement that the decision to free Kim had been based on "the personal humanitarian consideration of President Chun Doo Hwan." According to observers, the move was intended as a gesture to restore public confidence in the Chun government--shaken earlier this year by a billion-dollar financial scandal involving relatives of the South Korean first lady.

Chun is also believed to be eager to improve his country's image on human rights and to pave the way for the 1988 Olympics in Seoul. Many South Koreans regard that event as an important step toward greater prestige abroad and a boost for the developing industrial economy.

The freeing of Kim has been a key element of U.S. diplomatic efforts toward easing of Seoul's iron-clad political controls.

The South Korean Justice Ministry has approved the suspension of Kim's prison sentence, the sources said, although no official announcement has yet been made.

Kim was arrested in May 1980 in the military crackdown that brought Chun and his coterie of military colleagues to power in South Korea. Along with two dozen opposition party politicians, Kim was convicted by a military court of having helped to touch off a bloodly anti-government uprising at Kwanju. He was also charged with inciting campus and labor unrest from his exile abroad in the early 1970s.

In September 1980, Kim was sentenced to death, a decision later upheld by an appeals court. Chun ordered commutation to life imprisonment in January 1981, shortly before he visited Washington for talks with President Reagan.

It was speculated at the time that Washington had arranged the trip on the condition that Kim's life be spared. Earlier this year, Kim's sentence was further reduced to 20 years and Vice President Bush, during a visit in April, is believed to have asked Chun to free Kim.

A State Department spokesman characterized Kim's trip to the United States as a personal one. The consulate in Seoul issued him a five-year multiple-entry visa for medical treatment, the spokesman said, adding that Kim would be free from any special controls on his political activities while in the United States.

The disposition of Kim's case proved to be one of the thorniest issues between the United States and South Korea during the Carter administration. Washington warned that his execution would have serious consequences for diplomatic, economic, and possibly military ties.

The case also churned up strong emotions in Japan, where officials threatened to cut off economic aid.

Kim rose to prominence in South Korea in 1971, when he lost that year's presidential election by a narrow margin to Park Chung Hee. Kim soon was jailed but following the 1979 assassination of Park, the opposition leader was freed in a general amnesty. He again declared his intention to run for president and was touted as the opposition's frontrunner before his arrest in May 1980.

Last week, Minister of Culture and Information Lee Jeen Hi said the decision on Kim had been taken to show "the strong determination of Chun's Fifth Republic to consolidate national unity by eradicating the residue of the past."

The Associated Press added from Seoul:

Those released Friday included 1,158 common criminals plus almost all dissidents involved in the nation's politically controversial cases after the assassination of President Park Chung Hee in October 1979.

They included Professor Lee Moon Yung and six other defendants convicted of sedition in 1980 with Kim.