Thousands of students climbed trees and pushed against barricades to catch a glimpse of the Microsoft chairman and world's richest man.
The students lined up outside the auditorium at the Hanoi University of Technology to try and catch a glimpse of Gates ahead of his speech on the future of technology.
The visit is being seen as boosting Vietnam's efforts to develop it's high-tech sector following a recent push by the government to develop a knowledge-based economy.
In his address to students Gates outlined how the rapid growth of the internet had opened new opportunities for countries like Vietnam.
"Now that the Internet has connected the world, some of the opportunity is not so much defined by geography but today it is much more determined by the educational investment you make," he said.
"I certainly encourage students to use the internet as much as possible and learn about the global economy. Most of the opportunity for Vietnam is in the global economy."
"Most of the opportunity for Vietnam is in the global economy"
Chairman of Microsoft
'Ready to listen'
Earlier Phan Van Khai, the Vietnamese prime minister, and Tran Duc Luong, the country's president, welcomed the Microsoft boss to Vietnam.
"I'm ready to listen to your advice," Khai said after outlining Vietnam's 20-year-long reforms that took it from a centrally planned economy to one driven by markets.
The two also met last year in Seattle when Khai became the first Vietnamese leader to visit the United States since the end of the Vietnam War in 1975.
Analysts see education in technical skills and foreign languages - particularly English - as key to developing Vietnam's technology sector. About half of Vietnam's 83 million people are under 30 years old.
There has been an explosion of Internet cafes in Vietnam in the last five years, with thousands opened around the country.
Gates (R) meets Vietnamese
President Tran Duc Luong
Internet usage has grown though the government has tried to maintain control by setting up firewalls on political or pornographic sites deemed harmful.
Vietnam is keen to jump-start its high-tech sector, which recieved a boost earlier this year when the world's largest chipmaker Intel Corporation announced plans to build a $300 million assembly plant in Ho Chi Minh City.
Truong Gia Binh, the head of FPT, Vietnam's leading software and computer company, said Gates' visit is seen as an official nod of recognition that Vietnam has potential.
"This is a major opportunity for Vietnam," Binh said, noting the country's 800 software development companies have already made inroads in attracting outsourcing work from leading IT companies globally.