A day after his four-hour quarter-final victory, the 22-time Grand Slam champion was again tested by Ajdukovic, the world number 130 who had won just two tour-level matches before this week.
The Spaniard rebounded from dropping the opening set to prevail 4-6, 6-3, 6-4, returning to the final of a tournament he won as a teenager on his last appearance in 2005.
"It was a very tough match. It was very difficult honestly, but I found a way to survive and be through to the final after a long time without being in a final, so that's great news and I'm very happy with that," said Nadal.
The 38-year-old will play Portuguese seventh seed Nuno Borges or Argentina's Thiago Agustin Tirante on Sunday as he goes in search of the 93rd singles title of his career.
His most recent triumph came two years ago at Roland Garros, when he won the tournament for a record-extending 14th time.
"It's always a great feeling to be back in the final. I won four matches in a row, something I wasn't able to make happen since two years ago," said Nadal, whose ranking has tumbled to 261 after a string of injuries.
"A lot of things happened... I'm still in this process of recovering a lot of things I lost because I had a very important hip surgery almost one year ago, so things are not going that easy.
"But I'm fighting. I've fought during the whole tournament to be where I am today. Matches like yesterday and today help to improve a lot of things on court, so I'm happy with that. Let's see if I'm able to play a little bit better tomorrow."
Nadal struggled early against the 23-year-old Ajdukovic as he fell 3-0 and a double break down in the opening set, but he fought his way back with two breaks in the second after another poor start.
The former world number one appeared in complete control in the third set when he surged 3-0 ahead only to lose his serve twice in succession, suffering a repeat of the stumble that nearly cost him on Friday.
He broke again in the seventh game and then resisted two more break points in the next, eventually securing victory with a comfortable hold two games later.
Nadal is using the event in Bastad as a tune-up for the Olympic Games, where the tennis will be played on the clay at Roland Garros. He won gold in the singles in Beijing in 2008 and gold in the doubles at Rio 2016.
He only returned to action this week for the first time since losing in the first round of the French Open in late May.
Nadal was also due to play in the doubles later on Saturday alongside Casper Ruud but announced he was pulling out as a precaution after spending six hours on court over his past two singles matches.