JK Rowling, the multimillionaire author of the Harry Potter novels, has donated £1m to the campaign against Scottish independence after warning that it could be a "historically bad mistake" to leave the UK.

Rowling said she believes Scotland is an "exceptional" country but is convinced that independence would carry serious economic risks, damaging funding for the world-class medical research she has supported with multimillion-pound donations after her mother's death from multiple sclerosis.

Her £1m donation was made on Tuesday, just as the yes and no campaigns marked 100 days to September's referendum. It was the the biggest donation yet made to the pro-UK Better Together campaign, run by her friend and former neighbour, Alistair Darling.

While her support for the no camp is not unexpected, the size and timing of the donation delighted senior figures in the no campaign, coming to light five days after the US president, Barack Obama, whose election victories have inspired the yes campaign, indicated that he opposed independence.

Rowling explained her decision in a 1,600-word essay on her website, arguing that devolution had allowed Scotland to flourish and protected its public services. She said she understood the romantic faith in Scotland's capacity to stand on its own, and that the argument that it could be fairer, greener and more equal sounded "highly appealing". But she cited unanswered questions about currency and EU membership, as well as evidence that the Scottish government's spending plans were too reliant on volatile oil revenues.

"If we leave, there will be no going back. This separation will not be quick and clean: it will take microsurgery to disentangle three centuries of close interdependence, after which we will have to deal with three bitter neighbours."

She said rejecting independence would improve Scotland's standing with the rest of the UK, improving its chances of getting further powers, and would allow her adopted home country to flourish.

Rowling, who moved to Edinburgh in 1993, added that she was bracing herself for abusive attacks from hardline nationalists who questioned her English roots and demonised any critics of independence. "By residence, marriage, and out of gratitude for what this country has given me, my allegiance is wholly to Scotland and it is in that spirit that I have been listening to the months of arguments and counter-arguments," she said.

Rowling's support for Better Together, which has struggled to keep pace with the £3.5m in donations to the pro-independence group Yes Scotland from Euromillions winners Chris and Colin Weir, became public when she appeared as Darling's guest of honour at a fundraising concert for the no campaign earlier this year.

She made clear that she opposed independence in a BBC interview in September 2012, stating that the global recession was a bad time to consider leaving the UK. "I just think now is a time for stability. And Scotland's doing great under devolution. I think economically we're in a pretty stable, sound condition," she said.

As well as donating a reputed £160m to medical research, single mothers' charities and other causes, Rowling has publicly supported the Labour party. Rowling, who is a friend of Sarah Brown – the wife of former prime minister Gordon Brown – donated £1m to Labour in 2008.

Her gift to Better Together was welcomed by Margaret Curran, Labour's shadow Scottish secretary, who said it was a "significant and welcome intervention from one of this country's most talented and successful women". "Separation is failing to win support among women and more and more of us are saying 'No thanks' to Alex Salmond's plan. It doesn't take a wizard to work out that Alex Salmond's case for breaking up the UK simply isn't a risk worth taking," she said.

Independence campaigners gave a more guarded response. Elaine C Smith, the Rab C Nesbitt star and Yes Scotland board member, said she was "obviously disappointed", but respected Rowling's right to donate to the no campaign. "As one of the world's leading fictional authors, I'm sure she can provide some good material for the no camp in the runup to September," she quipped.

David Greig, the playwright and a yes campaigner, said he thought Rowling's endorsement could make a difference to the campaign. "Not because she's a celebrity, but because it's accompanied by a really thoughtful, genuine piece of writing. A lot of undecided voters will read that and it will chime with them. And that's a good thing. We need more thoughtful and interesting contributions," he said.

Better Together officials said the gift, which dwarfs the gifts of other celebrity backers, such as the £501 given by former Manchester United manager Sir Alex Ferguson, would help fund the campaign's running and staffing costs.

As Curran renewed her appeal for further donations to the no campaign, the group insisted Rowling's money would not put the organisation in breach of its official £1.5m spending limit imposed by the Electoral Commission for the final 16-week referendum campaign. Better Together said they employed nearly 40 full-time staff, and remained short of cash.

The £1.5m spending limit covered advertising, events, campaigning costs and office overheads but not staff salaries.

Polling evidence suggests more than 90% of voters believe they are not influenced by celebrity endorsements. John Curtice, the polling expert at Strathclyde university, said they could be very effective at generating positive publicity around a campaign, but Scottish referendum voters would pay attention to the detailed arguments.

"The Scottish referendum is not on a subject which people know very little about and are therefore looking for people to give them cues: this is a serious debate which touches on people's values and have been arguing about for 40 years."