NEW YORK — Loretta Swit, the beloved actress known for her role as Major Margaret Houlihan on the iconic television series "M.A.S.H.," has died at the age of 87. Her publicist, Harlan Boll, confirmed that Swit passed away on Friday at her home in New York City, likely due to natural causes.

Swit was one of the longest-serving cast members on "M.A.S.H.," which aired on CBS from 1972 to 1983. The show, based on Robert Altman’s 1970 film and a novel by Richard Hooker, depicted life at the 4077th Mobile Army Surgical Hospital during the Korean War. The series finale, which aired on February 28, 1983, attracted over 100 million viewers, making it the most-watched episode of any scripted series in television history.

"M.A.S.H." received critical acclaim, ranking 25th on Rolling Stone's list of the best TV shows of all time and 34th on Time Out's list. It also won a Peabody Award in 1975 for its unique blend of humor and poignant commentary on the nature of war.

In the original film, Houlihan was portrayed as a one-dimensional character, often referred to as "Hot Lips." However, Swit transformed the role into a more complex and relatable character. She downplayed the sexual aspects of Houlihan and worked closely with the show's writers to develop her character into a strong, intelligent woman. "Around the second or third year I decided to try to play her as a real person, in an intelligent fashion, even if it meant hurting the jokes," Swit explained in an interview.

Initially, "M.A.S.H." struggled to find its audience, finishing its first season in 46th place out of 75 network series. However, it gained traction in its second season, pairing with the highly-rated "All in the Family." The show ultimately garnered nine Emmy nominations and won the award for Best Comedy in 1974.

Swit appeared in nearly every episode of the series, addressing significant issues such as PTSD, sexism, and racism. Her portrayal of Houlihan resonated with many viewers, and she advocated for better representation of women in the show. Alan Alda, who played Hawkeye, noted, "One of the things I liked, with Loretta’s prodding, was every time I had a chance to write for her character, we’d get away from the Hot Lips angle and find out more about who Margaret was. She became more of a real person."

The series concluded with a hopeful ending for Houlihan, who debated her next overseas assignment before ultimately deciding to return to America. Swit expressed her disagreement with the character's decision, stating, "I didn’t think that was correct for my Margaret. I think her next move was Vietnam."

After "M.A.S.H.," Swit became an advocate for animal welfare and published her memoir, with proceeds benefiting various animal-related charities. She was married to actor Dennis Holahan from 1983 until their divorce in 1995.

Born in Passaic, New Jersey, Swit began her acting career in touring productions before moving to Hollywood in 1969. She appeared in several television series before landing her breakthrough role in "M.A.S.H." Swit also returned to the stage, performing in Broadway productions and regional theater.

Loretta Swit's legacy as a pioneering actress and her impact on television will be remembered by fans and colleagues alike.