Croatia were heading into the round of 16 as Group B runners-up as they defended a 1-0 lead against Italy.
Modric had scored Croatia’s goal in the 55th minute but was then substituted 10 minutes from full-time, meaning he could only watch on in horror as Mattia Zaccagni scored a late equaliser.
The result meant Italy moved up into second place, with Croatia’s two points unlikely to be enough for progression as one of four best third-placed teams.
At 38, Modric became the oldest goalscorer in European Championship history when he netted against Italy, and despite rumours he may retire after the tournament, insisted he would be continuing.
“I’d like to keep playing forever but there will probably be a time I’ll have to hang up my boots,” Modric, who was named player of the match, said. “I’ll keep playing on, I don’t know for how much longer.”
The Real Madrid midfielder also described the result against Italy as “unfair”, comparing the heartbreak to Croatia’s quarter-final defeat to Turkey at Euro 2008. Modric’s team had taken the lead late in extra time, but conceded an equaliser and then lost on penalties.
“We kept battling right until the end but unfortunately football was merciless with us tonight,” said Modric. “It was cruel… but that’s part and parcel of football.
“It’s hard when you lose like this to find the words to describe how you feel.
“Perhaps it’s unfair because we all really fought for Croatia right from the first whistle until the last. We should be proud of the way we represented our country tonight.”
Modric added: “It’s hard to actually to outdo the Turkey game from 2008 but this game probably runs it pretty close. It’s certainly a sad day for us and the Croatian national team.”
To remain in the tournament, Croatia need England to beat Slovenia 3-0 or by four goals, and for Denmark to secure a win over Serbia.