SANTA FE, N.M. — John Pinto, a Navajo Code Talker in World War II who became one of the nation's longest serving Native American elected officials as a New Mexico state senator, has died. He was 94.

Senate colleague Michael Padilla confirmed Pinto's death in Gallup on Friday after years of suffering from various illnesses that rarely kept him from his duties.

After serving as a Marine, Pinto was elected to the Senate in 1976 and represented a district that includes the Navajo Nation for more than four decades. The region is one of the poorest in the country.

"Words cannot express the sadness we feel for the loss of a great Diné warrior," said Navajo Nation President Jonathan Nez, using the indigenous word for Navajo. "He dedicated his life to helping others."

Born in Lupton, Arizona, on the Navajo Nation to a family of sheep herders. Pinto didn't start formal schooling until he was nearly a teenager.

"At the age of 12, I was in kindergarten," Pinto told the Albuquerque Journal in a 2007 interview. "I guess I did all right."

Pinto also recalled that his grandparents told of being forced at gunpoint from their land in the 1860s by the U.S. Army in the forced relocation of the Navajo people on foot to southern New Mexico.

Today our state lost a legend, & I lost an old friend. Senator John Pinto and I became very close during the time we served together in the Senate. At 29, I was the youngest senator, & at 83, he was the oldest. We often ate together and worked together over the next six years. pic.twitter.com/rp40nJwrat — Mayor Tim Keller (@MayorKeller) May 24, 2019

After serving as a Code Talker — a group of radio men who translated American coordinates and messages into an indecipherable code based on the Navajo language — Pinto had to take an English test four times before he was finally admitted into the University of New Mexico's College of Education.

He graduated with a bachelor's in elementary education at 39, and eventually earned his master's, becoming a teacher and a truancy officer in Gallup.

Pinto delved into politics to address the needs of impoverished indigenous populations. The Democrat won a seat in state Senate in 1976 as one of the state's first Native American senators.

An unassuming appearance and manner belied Pinto's political determination that carried him through 42 years in the Legislature. Laurie Canepa, the senior librarian for the Legislative Council Service, said that made him the longest serving senator in state history.

State Sen. Manny Aragon, D-Albuquerque, wraps the state flag around Sen. John Pinto, D-San Juan, McKinley, as Gov. Gary Johnson, from right, looks on during a ceremony at the state capitol building in Santa Fe, N.M., on Sept. 12, 2001, to honor Pinto for his service during World War II as a Navajo Code Talker. Sarah Martone / AP file

Manny Aragon, the state's one-time Senate president, tells the story of driving to the Statehouse in a January 1977 snowstorm and picking up a middle-aged Navajo man who was hitchhiking in Albuquerque. The hitchhiker was newly elected Sen. Pinto.

"I just thought he was a transient," Aragon said.

In the Legislature, Pinto advocated for education reform and anti-poverty programs. Receiving a lifetime achievement award in 2016, Pinto recalled going hungry at times as a child while his parents juggled odd jobs and said the experience influenced his work on issues of homelessness as a lawmaker.

Every year, Pinto would sing on the Senate floor the "Potato Song" — a Navajo song about a potato, planted in the spring and visited in the summer until it is harvested. Fellow senators, staff and aides clapped along to Pinto's rendition.

Lenore Naranjo, the Senate's chief clerk, says Pinto taught her bits of Navajo language over the decades.

"A beautiful man is all I can say," Naranjo said.