Higuita (EF Education First), formed part of an early breakaway group of six riders before riding off on his own on a descent with 46km to go of the 177.5km mountain ride from Colmenar Viejo to Becerril de la Sierra.
The group of general classification contenders containing Roglic (Jumbo-Visma) slowly closed the gap on Higuita but the 22-year-old Colombian held his own on the final descent and comfortably took the stage win with a gap of 15 seconds over Roglic.
"Today’s stage was perfect for me," Higuita said. "I could either win from a breakaway or from a sprint.
"Climbing Cotos I felt extraordinary good legs, and I was able to keep my chasers at bay. I went full gas to the finish line, as I was pretty motivated to give my team a stage win after such a difficult La Vuelta.
"I didn’t have any energy left, but I had my heart set on those dreams I’ve chased for so long. I didn’t assume victory was mine until 5 kilometres to go, as my chasers were quite strong and I was afraid they would catch me.
"My DS kept spurring me and insisted I could make it to the finish line. I was very emotional at the finish line because there were so many Colombian fans there.
"At La Vuelta 19, I’ve learnt not to give up, not even in the worse moments, and to be resilient. Every day is a whole different story on which one can triumph."
Roglic beat Alejandro Valverde (Movistar) in the sprint to take the runners-up spot and recovered second place overall from team-mate Nairo Quintana, who suffered on the grinding mountain stage after his superb performance the previous day on the flat stage.
Quintana’s exploits on Wednesday’s wind-hit stage had trimmed the gap behind Roglic to two minutes and 25 seconds and given him a fighting chance of a repeat of his 2016 victory but those hopes have now faded.
He didn't have the legs to stay with the overall contenders and finished eighth in the stage, 61 seconds behind Roglic and Valverde.
Quintana is now three minutes 31 seconds away from Roglic and 41 seconds behind Valverde with effectively only two stages left to make a difference.
Roglic will expect to maintain his gap over Valverde in Friday’s flat 165.2km stage from Avila to Toledo, with only one mountain stage remaining on Saturday before Sunday’s procession to Madrid.
"It was another hard day and the team was super strong again," Roglic said. "Yesterday our team pulled from kilometre zero, everyone 'a bloc' to control the breakaway.
"Today when Astana attacked in the penultimate climb, I was alone but Neilson [Powless] was up the front ready to wait for me. And in the end, it’s on me. I also had good legs and we need to continue our good job.
"Every day is important, we learned our lesson yesterday and I expect full gas racing every day. I don’t expect any easy day.
"We’re one day closer [to the victory in Madrid]. It was another hard day, another good day for me and my team. We can be optimistic and retain focus until Madrid."