WASHINGTON — The Senate on Thursday upheld President Obama’s birth control policy, voting to kill a Republican effort to let employers and health insurance companies deny coverage for contraceptives and other items they object to on religious or moral grounds.

The 51-to-48 vote illustrated a sharp divide between the parties and brought to the Congressional forefront the social issues that have roiled the race for the Republican presidential nomination. Over four days of debate, Democrats accused Republicans of infringing on women’s rights and focusing on issues long settled while Republicans accused Democrats of threatening religious freedom and violating the Constitution.

“The Senate will not allow women’s health care choices to be taken away from them,” said Senator Patty Murray, Democrat of Washington.

The politically charged fight heated up last month after the Obama administration unveiled its policy requiring health insurance plans to offer free contraceptives for women — a rule that provoked furious criticism from Roman Catholic institutions and some other religious groups. The administration quickly offered a revision that would force the health insurers — not the institutions — to bear the cost.