Hrbaty ended Ljubicic's unbeaten run in Davis Cup play this year and beat the Croat for the first time in six meetings.
"Ivan had lost some five-setters recently," Hrbaty said.
Ljubicic was 4-10 in five-setters in his career; Hrbaty went in with a 12-7 record.
Ljubicic failed to equal John McEnroe's 1982 record of 12 Davis Cup wins in a year _ eight singles and four doubles. Ljubicic finished the year 11-1.
He said he woke up with neck pain that required treatment all morning.
"I didn't know if I would play or not," he said. "It was probably the most difficult decision I had to make in my career _ to play or not."
Ljubicic said he had to vomit when he left the court during the third set because he felt ill after taking painkillers. He also said he had trouble concentrating during the match.
"But Dominik really played well and deserved to win, it was the best match he played against me," Ljubicic said.
Ljubicic appeared to be cruising when he won the first set. But he fell behind 3-0 in the second and Hrbaty took a 2-1 lead in sets. The Slovak, ranked No. 19, committed two double-faults and a backhand error in dropping serve to give Ljubicic a 5-3 lead in the fourth. Ljubicic closed the set with an ace. He finished with 29 aces to Hrbaty's 15.
There were no breaks in the final set until the last game.
Ljubicic needed to win the game to stay in the match. But Hrbaty then got the benefit of the doubt on a pair of close calls, Ljubicic netted a backhand and Hrbaty held a match point. A backhand winner down the line saved it for Ljubicic, but a backhand volley again put Hrbaty one shot away from winning. Ljubicic saved it, too, but then put a backhand into the net.
Hrbaty ripped off his shirt and tossed it into the Slovak half of the crowd of about 4,000 at Sibamac Arena. But it would not be long before Croatia's fans had their moment.
"We saw three days of world-class tennis, and in the end the better team won," Mecir said. "I congratulate Croatia."