(CNN) -- Vietnamese Gen. Vo Nguyen Giap, who helped communist forces push French and later U.S. troops to withdraw after decades of war in the southeast Asian country, has died, according to local media reports.
He was 102.
Giap helped form Ho Chi Minh's communist rebels into an army while France tried to hold onto colonial rule in French Indochina after World War II -- and he eventually led the rebels in a key 1954 battle that led to France's withdrawal.
After the French left and Vietnam was partitioned into the communist North and the U.S.-backed South, Giap -- the North's defense minister and military commander -- helped guide the communists in a bloody 20-year war with the South and U.S. troops. The North took the entire county in 1975.
In 2004, Giap told CNN that a nation that stands up and knows how to unite will always defeat a foreign invader.
Giap made the comments after he was asked about the United States' involvement in Iraq -- but they also came as Vietnam was marking the 50th anniversary of the battle he led to spark France's withdrawal.
"When people have the spirit to reach for independent sovereignty ... and show solidarity, it means the people can defeat the enemy," Giap told CNN.
Born into a family of rice farmers, Giap got involved in politics at an early age. At 18 his politics got him thrown in jail, under suspicion of revolutionary agitation.
He earned a doctorate and students remember him as unusually passionate about military strategy. Theory became reality for Giap in the 1940s when he joined Ho Chi Minh and battled French colonial forces.
In 1954, Giap led the communist force in one of his most famous victories -- a 55-day seige of French forces at Dien Bien Phu, in the north of the country.
The siege ended when the French troops, worn down by constant artillery barrages and unable to resupply by air, surrendered on May 7, 1954.
That defeat saw the French withdraw, followed by the partitioning of Vietnam.
When American forces became involved in Vietnam, Giap championed guerrilla tactics, which became one of the hallmarks of the conflict.
Giap was the North's defense minister during the Tet offensive against U.S. and U.S.-backed forces in 1968. The surprise attack during the Vietnamese New Year festival targeted dozens of cities in South Vietnam, and both sides suffered heavy casualties before the offensive was repulsed.
The Tet offensive is considered as a turning point in the conflict, with the United States soon reducing the number of its troops in Vietnam as the U.S. public increasingly turned against the war.
The bulk of U.S. forces withdrew after the signing of the Paris Peace Accords in January 1973. But fighting between North and South continued until April 1975, when communist forces took over the South's capital of Saigon, now known as Ho Chi Minh City.
The 1954-1975 Vietnam War cost about 2 million Vietnamese military and civilian lives, the deaths of 55,000 U.S. troops, and about 6,000 service personnel from South Korea, the Philippines, Thailand, Australia and New Zealand.
Reflecting on the Dien Bien Phu victory, Giap told CNN in 2004 that the Vietnamese could never be slaves to anyone else.
"Nothing is more precious than freedom," Giap said.
U.S. Sen. John McCain, who as a Navy pilot was held prisoner by the North Vietnamese for more than five years after his plane was shot down, marked Giap's death on Twitter Friday.
"Gen. Vo Nguyen Giap has passed away -- brilliant military strategist who once told me that we were an 'honorable enemy,'" McCain tweeted.
CNN's Emma Lacey-Bordeaux and Jason Hanna contributed to this report