Slightly more than 60 percent of voted against the government's bid to redefine marriage as a union of two adults, while 37 percent were in favor, the country's electoral commission said on Sunday.
Only 35.6 percent of registered voters turned out at the polls in the predominantly Catholic nation of two million people.
Slovenia's parliament had approved legislation in March defining marriage as a "union of two" instead of being a "union of a man and a woman," effectively granting homosexual couples equal rights to marry and the right to adopt children.
Following the decision, a Catholic Church-backed movement calling itself "Children Are At Stake" quickly gathered the 40,000 signatures necessary to put the question to the public in a referendum for the second time since 2012. The previous effort to allow same-sex marriage was also rejected.
Reversing civil code
If the "no" camp prevails in the final count, then the civil code would be changed back, although existing legislation, which allows registered civil partnerships but not the adoption of children, would remain in force.
President Borut Pahor and Prime Minister Miro Cerar's ruling Modern Center Party (SMC) support the "yes" camp, saying gay marriage would eliminate discrimination and grant equal rights to all Slovenians.
Janez Jansa, the former center-right prime minister from the opposition Slovenian Democratic Party (SDS), came out against the move.
"Erasing the gender from the marriage (definition) gives ground to human rights' violations against our most precious -- our children," he said.
Same sex marriage has already been legalized in 18 countries around the world, 13 of them in Europe.
dj/jlw (Reuters, AFP, AP, dpa)