A total of 93 senators voted in favour of Wiacek while none opposed his appointment and five abstained.
Wiacek, a professor at the University of Warsaw and an expert in constitutional law, won cross-party support in the lower house on July 8.
Wednesday's vote in the upper house ends the five-month-long saga over who should be the next ombudsman. All the previous candidates were opposed by the opposition on the grounds that they were too closely associated with the ruling party, the conservative Law and Justice (PiS) party.
On April 15, Poland's Constitutional Tribunal ruled that the current ombudsman, Adam Bodnar, could no longer continue in his position because his five-year term had ended at the beginning of September last year.
In mid-June, Wiacek, who is supported by most opposition parties, was defeated in a vote in the Sejm, Poland’s lower house of parliament, by Lidia Staron, an independent senator supported by PiS.
After Staron, who was the Sejm's fifth nominee, lost in the Senate, PiS, in a surprise move, turned to Wiacek in a bid to put an end to the bitter conflict. (PAP)