Doohan died at 5:30 a.m. (1330 GMT) at his Redmond, Washington, home with his wife of 28 years, Wende, at his side, Los Angeles agent and longtime friend Steve Stevens said. The cause of death was pneumonia and Alzheimer's disease, he said.
The Canadian-born Doohan fought in World War II and was wounded during the D-Day invasion, according to the StarTrek.com Web site. He was enjoying a busy career as a character actor when he auditioned for a role as an engineer in a new space adventure on NBC in 1966. A master of dialects from his early years in radio, he tried seven different accents.
"The producers asked me which one I preferred," Doohan recalled 30 years later. "I believed the Scot voice was the most commanding. So I told them, 'If this character is going to be an engineer, you'd better make him a Scotsman.' "The series, which starred William Shatner as Capt. James T. Kirk and Leonard Nimoy as the enigmatic Mr. Spock, attracted an enthusiastic following of science fiction fans, especially among teenagers and children, but not enough ratings power. NBC canceled it after three seasons.
When the series ended in 1969, Doohan found himself typecast as Montgomery Scott, the canny engineer with a burr in his voice. In 1973, he complained to his dentist, who advised him: "Jimmy, you're going to be Scotty long after you're dead. If I were you, I'd go with the flow."
"I took his advice," said Doohan, "and since then everything's been just lovely."
"Star Trek" continued in syndication both in the United States and abroad, and its following grew larger and more dedicated. In his later years, Doohan attended 40 "Trekkie" gatherings around the country and lectured at colleges.
The huge success of George Lucas' "Star Wars" in 1977 prompted Paramount Pictures, which had produced "Star Trek" for television, to plan a movie based on the series. The studio brought back the TV cast and hired director Robert Wise. "Star Trek: The Motion Picture" was successful enough to spawn five sequels with the cast of the original TV show; other films, featuring cast members of "Star Trek: The Next Generation," have followed.
The powerfully built Doohan spoke frankly in 1998 about his employer and his TV commander.
"I started out in the series at basic minimum -- plus 10 percent for my agent. That was added a little bit in the second year. When we finally got to our third year, Paramount told us we'd get second-year pay! That's how much they loved us."
He accused Shatner of hogging the camera, adding: "I like Captain Kirk, but I sure don't like Bill. He's so insecure that all he can think about is himself."
James Montgomery Doohan was born March 3, 1920, in Vancouver, British Columbia, youngest of four children of William Doohan, a pharmacist, veterinarian and dentist, and his wife Sarah. As he wrote in his autobiography, "Beam Me Up, Scotty," his father was a drunk who made life miserable for his wife and children.
At 19, James escaped the turmoil at home by joining the Canadian army, becoming a lieutenant in artillery. He was among the Canadian forces that landed on Juno Beach on D-Day. "The sea was rough," he recalled. "We were more afraid of drowning than the Germans."
The Canadians crossed a minefield laid for tanks; the soldiers weren't heavy enough to detonate the bombs. At 11:30 that night, he was machine-gunned, taking six hits: one that took off his middle right finger (he managed to hide the missing finger on screen), four in his leg and one in the chest. The chest bullet was stopped by his silver cigarette case.
After the war Doohan on a whim enrolled in a drama class in Toronto. He showed promise and won a two-year scholarship to New York's famed Neighborhood Playhouse, where fellow students included Leslie Nielsen, Tony Randall and Richard Boone.
His commanding presence and booming voice brought him work as a character actor in films and television, both in Canada and the United States.
Oddly, his only other TV series besides "Star Trek" was another space adventure, "Space Command," in 1953.
Doohan's first marriage to Judy Doohan produced four children. He had two children by his second marriage to Anita Yagel. Both marriages ended in divorce. In 1974 he married Wende Braunberger, and their children were Eric, Thomas and Sarah, who was born in 2000, when Doohan was 80.
In a 1998 interview, Doohan was asked if he ever got tired of hearing the line "Beam me up, Scotty" -- a line that, reportedly, was never actually spoken on the TV show.
"I'm not tired of it at all," he replied. "Good gracious, it's been said to me for just about 31 years. It's been said to me at 70 miles an hour across four lanes on the freeway. I hear it from just about everybody. It's been fun."