The Euro 2016 champions appeared to be cruising to victory when goals from Andre Silva and Joao Mario gave them a 2-0 advantage inside 35 minutes, but Anice Badri halved the deficit before half time to give Tunisia hope.
The African nation - who will open their World Cup campaign against England on June 18 - then levelled things up midway through the second half courtesy of Fakhreddine Ben Youssef's strike, sealing a memorable comeback with exactly three weeks to go until their first match in Russia.
Tunisia threatened to break the deadlock inside the very first minute against a Portugal side missing talisman Cristiano Ronaldo following his Champions League exploits on Saturday night, with Saif-Eddine Khaoui collecting the ball inside the box but firing wide of the target.
Portugal soon recovered from that shaky start, though, and they should have taken the lead after just 10 minutes when Ricardo Quaresma blazed a golden opportunity over the crossbar.
Quaresma went some way to atoning for that miss midway through the first half, though, providing the cross for the opening goal which rumoured Wolverhampton Wanderers target Silva nodded home from close range.
Tunisia did not let their heads drop after that setback, though, and they almost responded immediately when Khaoui again came close, this time flashing an effort inches past the right post from inside the area.
It was Portugal who got the game's second goal with just over 10 minutes remaining of the first half as West Ham United midfielder Mario picked up a loose ball on the edge of the box and fired his finish into the top corner.
Once again Tunisia responded well to the goal, and this time they were able to get their own name on the scoresheet just five minutes later as Badri's effort from the edge of the box beat Anthony Lopes.
Portugal stepped up the tempo in the early stages of the second half as they looked to regain their two-goal advantage, and they were inches away from doing so 10 minutes after the restart when Bernardo Silva's effort at the end of a solo run came back off the post before Mario failed to beat Mouez Hassen from the rebound.
The hosts did have the ball in the back of the net shortly after the hour mark when William Carvalho converted, but his celebrations were cut short by the offside flag.
It proved to be an important decision by the officials as Tunisia were level inside two minutes, with Ben Youssef meeting Ali Maaloul's deep cross and firing it past Lopes into the bottom corner after some poor Portuguese defending.
Not content with just a draw, Tunisia pushed for a winner in the final 25 minutes with Hamdi Nagguez among those to threaten for the visitors.
However, Portugal held off the late pressure to ensure that they at least came away from the match with a draw, although Tunisia will be the happier of the two teams at the end of their first World Cup warm-up match.
Fernando Santos's side will now take on Belgium and Algeria in their final two friendlies before the tournament gets underway, while Tunisia's preparations continue with games against Turkey and Spain.
PORTUGAL (4-3-3): Lopes; Pereira (Cedric 72'), Pepe (Fonte 63'), Dias, Guerreiro (Rui 46'); Mario (Moutinho 80'), William, Adrien Silva (Fernandes 63'); Bernardo (Guedes 72'), Andre Silva, Quaresma
TUNISIA (4-4-2): Hassen; Nagguez, Benalouane, Meriah, Haddadi (Maaloul 46'); Badri (Akaichi 87'), Skhiri, Sassi, Sliti (Srarfi 76'); Khaoui (Ben Youssef 46'), Khalifa (Chalali 67')