Returning to Boulder, he was on an upward trajectory, winning reinstatement to the Navy in 1949.

Unlike some of his fellow astronauts, Carpenter was never a combat pilot. During the Korean War, he flew on anti-submarine patrols and surveillance sorties over the Formosa Strait, the Yellow Sea and the South China Sea.

At the Navy's test-pilot school in Patuxent River, Md., he made a name for himself wringing out developmental fighter jets. After further training, and service as an air intelligence officer on the carrier Hornet, he applied for Project Mercury.

"I volunteered for this project for a lot of reasons," he said after being selected in 1959. "One of them, quite frankly, is that it is a chance for immortality."

Besides Carpenter and Glenn, the other Mercury astronauts were Alan B. Shepard Jr., Gus Grissom, Wally Schirra, Gordon Cooper and Deke Slayton. Glenn, a former U.S. senator from Ohio, is the last surviving member of the group.

As their training progressed, the seven Mercury astronauts divided into two camps, Tom Wolfe wrote in "The Right Stuff." Wolfe said Glenn and Carpenter were the straight-arrow, church-going, family-oriented astronauts, while the others, led by Shepard, favored the looser lifestyles of "fighter jocks."

On May 5, 1961, Shepard made the first American manned space flight, a suborbital trip that came almost a month after the world's first manned flight, by Soviet cosmonaut Yuri Gagarin. Astronaut Virgil I. "Gus" Grissom made America's second suborbital flight on July 21, 1961.

Glenn made America's first orbital flight six months later. "Godspeed, John Glenn," Carpenter famously said as his friend lifted off.

Three months after that, it was Carpenter's turn. Although the trip ended well, grumblings about his inaccurate landing continued for years.

Flight director Chris Kraft charged that Carpenter's lack of discipline caused the sloppy landing and unnecessarily generated concern about his fate. Carpenter acknowledged pilot errors, but argued that he overcame "anomalous instrument readings, a tyrannical flight plan, unpleasant cabin temperatures and multiple and contradictory demands from the ground" to complete the mission.

On Aug. 29, 1965, Carpenter became the nation's first astro-aquanaut, descending 200 feet to the ocean floor off La Jolla to launch an undersea habitation called Sealab II.

He and three other men conducted experiments to determine how well humans can function in a high-pressure undersea capsule for extended periods. They mined ore from the ocean bottom, harvested fish, salvaged and refloated a sunken jet fighter and built an undersea petroleum-exploration platform.

"The sea is a tough adversary, a much more hostile environment than space," Carpenter said after emerging a month later. "But man has an incredible faculty to adapt in a hostile environment."

After his retirement from the Navy in 1969, Carpenter founded several small businesses and made occasional appearances on the lecture circuit. In 2003, he published his memoirs, "For Spacious Skies: The Uncommon Journey of a Mercury Astronaut," co-written by his daughter, Kristen Elaine Stoever.

He described his life as a "rare personal achievement and self-destruction of equal virtuosity: six cars totaled, four marriages, seven children. From all of them, somehow, boy and man always managed to walk away."

Carpenter, who had homes in Vail, Colo., and West Palm Beach, Fla., married Rene Louise Price in 1948, Maria Roach in 1972, Barbara Curtin in 1988 and Patricia Kay Snyder in 1998.

In addition to wife Patty and Stoever, he leaves daughters Robyn Jay Carpenter and Candace Noxon Carpenter; sons Marc Scott Carpenter, Matthew Scott Carpenter, Nicholas Andre Carpenter and Zachary Scott Carpenter; one grandchild and five stepchildren.

Staff writer David Colker contributed to this report. Malnic, a former Times staff writer who died in 2010, prepared much of this report before retiring in 2006.