The Royal Institution has been bailed out of a cash crisis that threatened to force the organisation from its Mayfair home. Sir Richard Sykes, chairman of the 200-year-old institution, said it had received a donation of £4.4m that would clear its debts and give the board time to develop a fresh strategy to finance the charity.

The cash from an anonymous foundation will pay off the RI's immediate loan and overdraft which had to be settled by March. The loan was secured against the RI's premises, an imposing £60m grade I-listed building in Mayfair.

The windfall has bought the RI a stay of execution, but senior figures still face a huge challenge to define a modern role for the institution, and forge partnerships with charities and businesses to overcome its long-term financial problems. The RI must repay a second loan of £2m in 2015 and is losing £1m a year in running costs.

Speaking at a special general meeting in London on Tuesday night, Sykes said the donation lifted the immediate prospect of having to sell the RI's home, and provided "breathing room to explore other options more fully".

Martin Knight, chair of the RI's finance committee said: "Some people might say we've been saved. We've not been saved, we've merely staved off the evil day."

The task of defining a fresh vision for the RI falls to the new "future direction committee", chaired by Lord Winston. Also members are: Sir Paul Nurse, president of the Royal Society; Professor Colin Blakemore, an Oxford neuroscientist; and physicists Brian Cox and Jim Al Khalili.

Winston said the RI aimed to partner with other organisations, and to focus on education and public communication of science, using the internet to draw in a global audience. "We are not looking at trying to sell the building, he said.

Sykes said the RI must decide on a clear vision for its future before it could go out looking for backers. He said Prince Andrew had convened philanthropists at Buckingham Palace to discuss the crisis.

Established in 1799, the Royal Institution is one of the world's oldest scientific organisations. It was made famous through leaps in scientific knowledge, such as Michael Faraday's first demonstration of the power of electricity. The organisation was founded to improve links between science and society, an aim that prompted Faraday to establish the Christmas lectures, which run to this day.

It ran into financial trouble after a £22m refurbishment in 2008 that coincided with the economic downturn. The board's hopes to modernise the institution and turn it into a "salon" for science failed to attract enough paying visitors.

In January it emerged that estate agents had shown potential buyers around the building in Albermarle Street, to the dismay of those who consider the RI part of Britain's scientific heritage.

Fears that the RI might lose its home sparked several grass roots campaigns by Nobel prize winners and other prominent scientists. Harry Kroto, who won the Nobel prize for chemistry, backed efforts to urge the government or a wealthy philanthropist to buy the building. "I hope our representatives can succeed in bringing about a fresh approach which we all recognise will be needed for investment in the RI's 21st Century role, as not only the primary UK science education centre, but most importantly the spearhead of a global science educational initiative," Kroto said.

Plans put forward by Kroto and others call for a major effort to recruit fundraisers with a track record, and to turn the RI's much criticised restaurant into a shop that sells electric motor kits and samples of elements discovered at the RI. Further plans aim to increase the membership of the RI, which stands at around 3,500, one tenth that of the Royal Society for the encouragement of Arts, Manufactures and Commerce (RSA).