HOUSTON — Former astronaut Gene Cernan, the last person to walk on the moon, who returned to Earth with a message of “peace and hope for all mankind,” died on Monday in Texas following ongoing heath problems, his family said. He was 82.

Cernan was with his relatives when he died at a Houston hospital, family spokeswoman Melissa Wren said. His family said his devotion to lunar exploration never waned.

“Even at the age of 82, Gene was passionate about sharing his desire to see the continued human exploration of space and encouraged our nation’s leaders and young people to not let him remain the last man to walk on the Moon,” his family said in a statement released by NASA.

Cernan was commander of NASA’s Apollo 17 mission and on his third space flight when he set foot on the lunar surface in December 1972. He became the last of only a dozen men to walk on the moon on Dec. 14, 1972 – tracing his only child’s initials in the dust before climbing the ladder of the lunar module the last time. It was a moment that forever defined him in both the public eye and his own.

“Those steps up that ladder, they were tough to make,” Cernan recalled in a 2007 oral history. “I didn’t want to go up. I wanted to stay awhile.”

Cernan called it “perhaps the brightest moment of my life. … It’s like you would want to freeze that moment and take it home with you. But you can’t.”

Decades later, Cernan tried to ensure that he wasn’t the last person to walk on the moon, testifying before Congress to push for a return. But as the years went by he realized he wouldn’t live to witness someone follow in his footsteps – still visible on the moon more than 40 years later.

“Neil (Armstrong, who died in 2012) and I aren’t going to see those next young Americans who walk on the moon. And God help us if they’re not Americans,” Cernan testified before Congress in 2011. “When I leave this planet, I want to know where we are headed as a nation. That’s my big goal.”

Cernan died less than six weeks after another American space hero, John Glenn, the first American to orbit the Earth in 1962. Their flights weren’t the first or last of the Mercury and Apollo eras. Yet to the public they were the bookends of America’s space-age glory, starting with Godspeed John Glenn and ending with Cernan’s footprints on the moon.

On Dec. 11, 1972, Cernan guided the lander, named Challenger, into a lunar valley called Taurus-Littrow, with Harrison “Jack” Schmitt at his side. He recalled the silence after the lunar lander’s engine shut down.

“That’s where you experience the most quiet moment a human being can experience in his lifetime,” Cernan said in 2007. “There’s no vibration. There’s no noise. The ground quit talking. Your partner is mesmerized. He can’t say anything.

“The dust is gone. It’s a realization, a reality, all of a sudden you have just landed in another world on another body out there (somewhere in the) universe, and what you are seeing is being seen by human beings – human eyes – for the first time.”

Three days earlier, Cernan, Schmitt and Ronald Evans had blasted off atop a Saturn rocket in the first manned nighttime launch from Kennedy Space Center. Evans remained behind as pilot of the command module that orbited the moon while the other two landed on the moon’s surface. Cernan and Schmitt, a geologist, spent more than three days on the moon, including more than 22 hours outside the lander, and collected 249 pounds of lunar samples.

Completing their third moon walk on Dec. 14, Schmitt returned to the lunar module and was followed by Cernan.

“We leave as we came and, God willing, as we shall return, with peace and hope for all mankind,” Cernan said.

He later acknowledged that he had grasped for words to leave behind, knowing how the world remembered Neil Armstrong’s “giant leap for mankind” on stepping on the moon in 1969.

Before heading home, Cernan said he drew the letters “TDC” – the initials of his then 9-year-old daughter, Teresa Dawn – with his finger on the dusty gray lunar surface.

Eugene A. Cernan was born in 1934 in Chicago and graduated from Indiana’s Purdue University in 1956 with a degree in electrical engineering. (Armstrong also was a Purdue graduate.)

He had been a Navy attack pilot and earned a master’s degree in aeronautical engineering when NASA selected him in October 1963 as one of 14 members of its third astronaut class.

In 1973, Cernan became special assistant to the program manager of the Apollo program at Johnson Space Center in Houston, assisting in planning and development of the U.S.-Soviet Apollo-Soyuz mission. He was senior U.S. negotiator with the Soviets on the test project.

He retired from NASA three years later.

In all, Cernan logged 566 hours and 15 minutes in space, more than 73 hours of them on the moon’s surface.