The 33-year-old attacked on the fourth and final lap around the Catalan city's picturesque Moll de la Fusta port and dug deep in the final metres to hold off a late charge from Thomas Lurz of Germany who came in second.
Olympic champion Oussama Mellouli of Tunisia, who won Saturday's 5-km race, faded in the closing stages but just managed to pip France's Damien Cattin-Vidal and Richard Weinberger of Canada to clinch third.
After his triumph in Shanghai two years ago, it was a second straight world title in the gruelling event for Gianniotis, who finished fourth at the London Olympics.
He also becomes only the second man to successfully defend his 10-km gold after Russia's Vladimir Dyatchin in 2008.
"I was very close to the podium at the Olympics and I was very upset," he said in an interview with Spanish television broadcaster TVE.
"This year here today I was stubborn and I wanted to do it and I told myself that the Olympics was just a bad trip.
"I said to myself on the last lap give it everything and it was totally positive.
"The last 20 metres were very, very, very hard but I had the psychology and the will power."
A former long-distance pool swimmer who has an English mother, Gianniotis returned a winning time of one hour 49 minutes and 11.8 seconds.
Lurz, the Olympic silver medallist in London, finished in 1:49:14.5 and Mellouli 1:49:19.2.
China's Li Shixin drew inspiration from the spectacular hilltop setting to help secure his second consecutive men's one-metre springboard title.
The Montjuic pool affords stunning views over the Catalan capital and Li held his nerve through a tense battle to produce a superb final dive and extend Chinese domination in the event he won in Shanghai two years ago.
Ukraine's Illya Kvasha took silver, while Alejandro Chavez of Mexico sprang a surprise by pipping Li's team-mate Sun Zhiyi to the bronze. It was the first time China had failed to win both gold and silver in four championships.
"When I was younger my coach showed me a video of this pool during the 1992 Olympic Games," Li, who spends a lot of time in Spain and is known back home as 'the Spanish diver', said.
"It was my dream to compete here and of course to dive well," he added.
"I was a bit nervous until the fourth dive but then my coach told me to relax and I made my last two rounds with more confidence."
Li's gold was China's second of the championships after Wu Minxia won an unprecedented sixth three-metre springboard synchro title on Saturday and diving's dominant nation secured their third later on Monday when Chen Ruolin swept to her fourth 10-metre synchro gold in a row.
Chen and Liu Huixia, her fourth team-mate in four championships, amassed 356.28 points from their five dives, comfortably beating Canada's Meaghan Benfeito and Roseline Filion into second on 331.41.
Malaysia's Pandelela Rinong Pamg and Mun Yee Leong repeated their bronze medal from 2009 in third on 331.14.
Twice a double Olympic champion in the 10-metre individual and synchro in Beijing in 2008 and London last year, Chen said the secret of her success was simple, hard grind.
"Our coach often tells us: when you step down from the podium you start again from zero," she said.
"The experience is important but it is not enough to get a medal. You have to continue working hard.
"In 2007 when I got my first gold in this event with Jia Tong, we were a very new duet.
"Today, pairing with Liu is an entire new experience. She is very young, but at the same time very strong and quite adaptable."
In the men's springboard, Li trailed for the first four rounds of the final before moving into the lead in the fifth round with an inward 2.5 somersaults.
He then bagged 87.45 points for his sixth and last dive, a forward 3.5 somersaults, the highest score of the final, to triumph by more than 26 points.
"The other competitors were very strong," Li said. "I was simply luckier today."
Li scored 460.95 points, with Kvasha on 434.30, Chavez 431.55 and Sun 425.05.
Things have not always gone Li's way since his victory in Shanghai and he said suggestions from some quarters that he should retire had proved premature.
"My coach and my team leader always supported me to continue," he said. "They were right! Today, their help paid off.
"Spain is a very special country for me. Since 2005, I came here seven times so this is almost a second home for me."
China have won seven out of 10 one-metre springboard golds since the event was introduced in 1991, with Alexandre Despatie of Canada the last non-Chinese winner in 2005.
Russia's unstoppable synchronised swimming machine churned out a fourth consecutive team technical gold as Spain lifted the home support by taking silver.
The Russians did not even need Svetlana Romashina, who won gold in the solo technical event on Saturday, or the partner with whom she triumphed in Sunday's technical duet, Svetlana Kolesnichenko, to amass a daunting points total of 96.600.
Fans inside the Palau Sant Jordi, part of the complex on the Montjuic hill built for the 1992 Olympics, were rewarded when Spain snatched silver with 94.400, with Ukraine taking bronze on 93.300 for their first world championship podium.
Maria Shurochkina, one of Russia's eight-woman team, said: "We've trained hard for a year and it wasn't easy because there are five new members in our team so it was hard to work together at the beginning."
Alexandra Zueva added: "We are new and young members of the team. This is our first world championship gold, these emotions are new, that's why we are so happy."
China, who won silver at the last world championships in Shanghai two years ago, are not competing in the team events at the latest edition.
- Sports & Recreation
- Li Shixin