Yul Brynner, 65, the actor who played the arrogant and bombastic yet lovable King of Siam in Rodgers and Hammerstein's "The King and I" with such zest and enthusiasm that he remained identified with the part for almost 35 years, died early yesterday of complications resulting from cancer at the New York Hospital-Cornell Medical Center in New York City.

Mr. Brynner, who was known to theater audiences and filmgoers the world over for his shaved head, held the lead role at the March 29, 1951, New York opening of "The King and I," an immensely popular musical about an English teacher who travels to Siam in the 1860s to instruct the many children of the polygamous king. He played the part 4,625 times on stage between then and his final performance last June 29 at the end of a four-year, 30th anniversary revival of the show, and he also won an Academy Award for best actor in the 1956 movie version.

"You will never be anything but the king after this play," Richard Rodgers, who wrote the music for "The King and I," told Mr. Brynner not long after the show opened, and the statement proved to be prophetic. Although he appeared in more than three dozen movies, including such major parts as Dimitri Karamazov in "The Brothers Karamazov" (1958), the Russian prince in "Anastasia" (1956), Pharaoh in "The Ten Commandments" (1955), and as a gunslinger in "The Magnificent Seven" (1960) and "Westworld" (1973), Mr. Brynner never really relinquished the role he had helped create as the King of Siam.

The Broadway show ran for 1,246 performances before it closed on March 20, 1954, and it went on a one-year tour of the country after that. Mr. Brynner appeared in a 1977 revival of "The King and I," and again in a 1979 revival in London that ran for more than a year.

The 30th anniversary revival tour began in 1981, and it included a run at the Warner Theatre in Washington. In 1983, Mr. Brynner, a former five-pack-a-day cigarette smoker, left the show for radiation treatment upon learning that he had lung cancer, but he returned and by the time it reopened on Broadway just before Christmas of 1984 he announced the disease was in remission.

Based on a true story of Anna Leonowens, a proper Englishwoman who went to Siam in the 1860s to instruct the King's children, "The King and I" played to live audiences of more than 3.6 million on Broadway and to an additional 4.5 million on the road with Mr. Brynner in the lead role, according to Mr. Brynner's office.

Initially, Mr. Brynner played opposite Gertrude Lawrence in the show, but she died during the first run in New York, and since then Mr. Brynner has played the King to more than a dozen "Annas." He once observed that while the show was running he spent 85 percent of his waking hours involved in the part in one way or another.

"I absolutely fell in love with the King," Mr. Brynner said on several occasions, and he thrust himself into the role with such feeling that theatergoers shared his delight. With his feet parted and his trunk thrust forward, his hands on his hips and his head and shoulders cocked gently to the rear, Mr. Brynner looked the part of a 19th Century Oriental potentate, in sharp contrast to the Victorian Anna whose traditional Western values clashed repeatedly with the customs of the royal Siamese Court, including the bowing and scraping and the King's many wives.

Born Taidje Khan on the island of Sakhalin north of Japan, Mr. Brynner was the son of a Mongolian mining engineer and a Gypsy mother who died at his birth. His father had been born in Switzerland and later obtained Swiss citizenship and changed the family name to Brynner.

As a child, Mr. Brynner lived in China, but he went to Paris to live with his grandmother when he was 8, attended schools there for a time, but then dropped out when he was 13 to join a Gypsy troupe as a traveling minstrel. Later he worked as a high trapeze artist in a French circus, but eventually he gave that up for the stage, and in 1941 he came to the United States as part of a struggling group of actors playing Shakespearean plays on college campuses.

He was a French language radio announcer for U.S. Office of War Information during World War II, then in 1946 made his Broadway debut as an Oriental prince opposite Mary Martin in "Lute Song," a marginally successful show that had 142 performances in New York. Later he toured the country with "Lute Song," but most importantly he impressed Martin, who subsequently recommended him to Rogers and Hammerstein for the king in "The King and I."

Mr. Brynner had to leave a job as a television director for CBS to accept the part, and he did so with some misgivings and anxieties, which were only increased after the show opened for a trial run in New Haven in February of 1951.

"It was a disaster," Mr. Brynner recalled. "It was almost five hours long. There was nothing but conflict between Anna and the King. There was no such thing as 'Shall We Dance?' "

In the weeks before the show opened in New York, the authors added two songs, "Shall We Dance?," and "Getting to Know You," trimmed the length of the show drastically and added an element of mutual fascination and affection between Anna and the King. It took him the first two or three years of the show's run, Mr. Brynner said later, but the role taught him how to act. By the end of his career he was said to have been earning $60,000 to $70,000 a week at it.

Mr. Brynner was married four times. His first wife was actress Virginia Gilmore. They had one son, Rock. He married Doris Kleiner in 1946, and they had a child, Victoria. In 1971, Mr. Brynner married Jacqueline Thion de la Chaume, and they adopted two Vietnamese orphans, Mia and Melody. He married Kathy Lee, who played the part of the lead royal dancer on the final tour of "The King and I" in 1983.