EDINBURGH — Voters in Scotland rejected independence from Britain in a referendum that had threatened to break up the 307-year union between them, according to projections by the BBC and Sky News early Friday.

Before dawn after a night of counting that showed a steady trend in favor of maintaining the union, Nicola Sturgeon, the deputy head of the pro-independence Scottish National Party, effectively conceded defeat for the “yes” campaign that had pressed for secession.

“Like thousands of others across the country I’ve put my heart and soul into this campaign and there is a real sense of disappointment that we’ve fallen narrowly short of securing a yes vote,” Ms. Sturgeon told BBC television.

With 26 of 32 voting districts reporting, there were 1,397,077 votes, or 54.2 percent, against independence, and 1,176,952, or 45.7 percent, in favor.