|Sergi Garcia receives the trophy from Ukrainian Vice Prime Minister Oleksandr Vilkul and FIBA Europe Secretary General Kamil Novak|
Samuel Rodriguez scored the winning basket with seven seconds left, having been the man who missed two free throws which could have won the game with 2.8 seconds remaining in regulation time.
Hernandez had rated his team as underdogs for the final, just as they had been before seeing off then unbeaten Croatia in the quarter-finals, and was rightly proud of the fight they showed for all 45 minutes of the game.
"It feels fantastic," said Hernandez, taking charge of his first men's team after previously winning with the Spanish women at U16 level in 2008 and 2009.
"For me, it's the first time with a men's basketball team and it's amazing to be here with a gold medal.
"It was very difficult for us because we knew a lot of teams here were very strong but in the last few days we have played fantastically well. We have controlled the games. These players have big, big heart," he added, pounding his chest.
Rodriguez had trodden off the court disconsolate after missing those free throws but Hernandez immediately wrapped an arm around his 2.00m forward as the team huddled.
"I told him just to stay calm," he said. "It was important all the players remained calm. We had been playing very good defence and we just needed to continue. I told them they had worked fantastically hard for two months and they needed only five minutes more for glory."
The drama was far from over with Serbia's Stefan Peno - the tournament MVP - and Nikola Rakicevic missing late chances to win it along with Xabier Lopez-Arosteguj, but Rodriguez, fittingly, was on hand when it mattered most.
"We got lucky," Hernandez said. "Both teams could have won it in the end but we had the luck in the last action. My team deserves this championship."