President Karol Nawrocki swiftly signalled he would not sign it.
The Sejm, lower house of Parliament, approved the bill on Friday by 230 votes to 198, with one abstention.
A companion implementing bill, amending nearly 200 existing provisions to extend spousal rights to cohabiting partners, passed by the same margin.
Katarzyna Kotula, the government's equality minister and co-author of the legislation, welcomed the vote on X.
"For several months, many people worked on this project so that more than three million Poles could feel more dignity and security – both heterosexual families and, above all, LGBT couples who pay taxes but are still invisible to the state," she wrote.
Under the proposed rules, two adults would be able to sign a notarised agreement, registered with a civil registry office, granting them rights including shared property arrangements, maintenance obligations, access to a joint home and the ability to act as each other's medical proxy.
Nawrocki said he would refuse to sign any law he considered an alternative to marriage.
"I am the guardian of the Constitution. The Constitution states explicitly that marriage is a union between a man and a woman," he said.
He added he would be willing to sign a version of the bill that addressed practical and administrative needs without, in his view, undermining the institution of marriage.
Prime Minister Donald Tusk said he was "convinced that any decent person should think very hard before taking a negative decision" on the legislation.
He stopped short of predicting what the president would do, but noted that Nawrocki found it "much easier to veto and block than to help".
Opposition parties including Law and Justice (PiS) and Confederation voted against the bills, as did four MPs from the junior coalition partner PSL.
According to Poland's 2021 national census, the number of families fell by 800,000 (7.4 percent) over the previous decade.
While marriages have declined, the number of unmarried couples living together has grown significantly, from 316,500 in 2011 to 552,800 in 2021.
(ał)
Source: PAP