Samsonova, ranked more than 100 places below Martic, impressed in the opening set to break the Croatian and take the lead in the match but the 21-year-old soon discovered that beating a top 20 player was no easy task as Martic dug in.
As the sun set in Sicily, Martic seemed rejuvenated when the lights came on, breezing through the final set in 35 minutes without conceding a single break point and wrapped up the 2-1/2 hour contest with an ace to advance.
"The struggle was real out there today," Martic said. "She's not the type of player I like to play. She plays really fast, flat, low, on this court it can be tricky with bad bounces.
Indian Wells
Basilashvili stuns Tsitsipas to make Indian Wells semi-finals
"Overall I really didn't really enjoy myself. I was just going to have to fight."
Earlier, fourth seed Anett Kontaveit also had to mount a comeback after losing the opening set to Germany's Laura Siegemund before prevailing 3-6 6-2 6-2.
The 24-year-old from Estonia took time to adapt as Siegemund dictated the tempo of the match in the early stages but broke the German twice in the second set to take a 3-0 lead before closing out the set.
Kontaveit wrested control in the third set, breaking Siegemund twice again for the win but not before she saved four match points in the final game.
"Laura is a really tough opponent and I really felt like I had to lift my game in the second set and play more aggressive," Kontaveit said. "I think that's what made the difference after the first set."
ATP Indian Wells
How new British No 1 Norrie could reach ATP FInals after 'biggest win' of career
WTA Indian Wells
'The beginning of great things' - Jabeur makes history after reaching semis