Nearly 70 percent of the 250 members of the Church of Sweden's synod voted to allow same-sex couples to marry in its congregations from November 1 and adopted a marriage rite for gay weddings, the church said in a statement.
The Church of Sweden, which was the state church until 2000, had backed the parliament's adoption of the gay marriage law, which took effect on May 1. But it deferred its synod's decision on church weddings until now.
Sweden, already a pioneer in giving same-sex couples the right to adopt children, becomes one of the first countries in the world to allow gays to marry in a major Church.
Around three in four Swedes are members of the Lutheran Church.
The country's largest gay rights group, RFSL, welcomed the protestant church's decision.
"RFSL congratulates the Church of Sweden for its decision, your homosexual and bisexual members will finally be able to feel a little more welcome within society," it said in a statement.
But the group was disappointed that ministers can refuse to celebrate a gay marriage. In such cases, the Church should find another priest for the ceremony.
The country's smaller Orthodox and Roman Catholic churches said they were disappointed by the Lutherans' decision.
"It is with sadness that we learn about the decision by the synod of the Church of Sweden," Fredrik Emanuelson, a leader of the Roman Catholic Church, and Orthodox church senior official Misha Jaksic said in a joint statement.
"In our churches and communities, we will not unite homosexual couples since it is in complete contradiction with the tradition of the church and our vision of creation," they said.