HANOI, Vietnam — Gen. Vo Nguyen Giap, the brilliant and ruthless commander who led the outgunned Vietnamese to victory first over the French and then the Americans, died Friday. The last of the country's old-guard revolutionaries was 102.

A national hero, Giap enjoyed a legacy second only to that of his mentor, founding president and independence leader Ho Chi Minh.

Giap died in a military hospital in the capital of Hanoi, where he had spent nearly four years because of illnesses, according to a government official and a person close to him. Both spoke on condition of anonymity before the death was announced in state-controlled media.

Known as the "Red Napoleon," Giap commanded guerrillas who wore sandals made of car tires and lugged artillery piece by piece over mountains to encircle and crush the French army at Dien Bien Phu in 1954. The unlikely victory — still studied at military schools — led to Vietnam's independence and hastened the collapse of colonialism across Indochina and beyond.

Giap then defeated the U.S.-backed South Vietnam government in April 1975, reuniting a country that had been split into communist and noncommunist states. He regularly accepted heavy combat losses to achieve his goals.

"No other wars for national liberation were as fierce or caused as many losses as this war," Giap told The Associated Press in 2005 — one of his last known interviews with foreign media on the eve of the 30th anniversary of the fall of Saigon, the former South Vietnamese capital.

"But we still fought because for Vietnam, nothing is more precious than independence and freedom," he said, repeating a famous quote by Ho Chi Minh.

Giap remained sharp and well-versed in current events until he was hospitalized. Well into his 90s, he entertained world leaders at his shady colonial-style home in Hanoi.

Although widely revered in Vietnam, Giap was the nemesis of millions of South Vietnamese who fought alongside U.S. troops and fled their homeland after the war, including the many staunchly anti-communist refugees who settled in the United States.

Born Aug. 25, 1911, in central Vietnam's Quang Binh province, Giap became active in politics in the 1920s and worked as a journalist before joining the Indochinese Communist Party. He was jailed briefly in 1930 for leading anti-French protests and later earned a law degree from Hanoi University.

He fled French police in 1940 and met Ho Chi Minh in southwestern China before returning to rural northern Vietnam to recruit guerrillas for the Viet Minh, a forerunner to the southern insurgency later known as the Viet Cong.

During his time abroad, his wife was arrested by the French and died in prison. He later remarried and had five children.

In 1944, Ho Chi Minh called on Giap to organize and lead guerrilla forces against Japanese invaders in World War II. After Japan surrendered to Allied forces the next year, the Viet Minh continued their fight for independence from France.

Giap was known for his fiery temper and as a merciless strategist, but also for being a bit of a dandy. Old photos show him reviewing his troops in a white suit and snappy tie, in sharp contrast to Ho Chi Minh, clad in shorts and sandals.

Giap never received any formal military training, joking that he attended the military academy "of the bush."

At Dien Bien Phu, his Viet Minh army surprised elite French forces by surrounding them. Digging miles of trenches, the Vietnamese dragged artillery over steep mountains and slowly closed in during the bloody, 56-day battle that ended with French surrender on May 7, 1954.

"If a nation is determined to stand up, it is very strong," Giap told foreign journalists in 2004 prior to the battle's 50th anniversary. "We are very proud that Vietnam was the first colony that could stand up and gain independence on its own."

It was the final act that led to French withdrawal and the Geneva Accords that partitioned Vietnam into north and south in 1956. It paved the way for war against Saigon and its U.S. sponsors less than a decade later.