Federer moves into Rotterdam semis
The Swiss, who is this week making his first appearance in the Dutch port city since he won the title in 2005, lacked rhythm against the unseeded Nieminen.
Former world number one Federer came back from 40-0 down in the 11th game to break serve on the indoor carpet and then had to rely on the tie-break to clinch victory in the second set.
"It was a tough match but important to get through," he told reporters. "I am still getting used to the surface and tonight I struggled with my timing in the rallies.
"But I also have to give credit to Jarkko the way he played. He was really aggressive and even on his second serve he kept attacking."
Juan Martin Del Potro and Tomas Berdych continued their good form in Rotterdam as they set-up a mouth-watering semi-final with straight-sets wins.
Third-seeded Argentine Del Potro trounced seventh-seeded Serb Viktor Troicki 6-0 6-1.
Berdych, the second seed, beat Andreas Seppi of Italy 6-3 6-4.