In a week that would be capped by winning the Nobel Peace Prize, US President Barack Obama hosted public events celebrating the winners of the National Medal of Science and the National Medal of Technology and Innovation, as well as the White House's first-ever stargazing party. The week before that, Obama visited the campus of the National Institutes of Health (NIH) in Bethesda, Maryland, to announce that the agency had distributed half of the extra US$10.4 billion that Congress awarded it in February in the $787-billion stimulus bill.

Indeed, Obama has made the promotion of science and technology — and evidence-based decision-making — a frequent theme of his young presidency, and most US researchers consider this a refreshing contrast to the previous administration. But they would be wise to remind themselves that Congress, not the president, is in charge of most of the key issues affecting American research. And in particular, the stimulus money that Congress has funnelled into science this year and next has the potential to create a long-term problem.

In the short term, the stimulus bill passed last February has poured billions of dollars into the research agencies (see page 856), with the largest chunk going to the Department of Energy for much-needed programmes in energy efficiency, environmental clean-up and research. At other agencies, such as the NIH and the National Science Foundation (NSF), stimulus money has allowed managers to fund a backlog of individual grants and accelerate planning for major infrastructure projects such as the NSF's real-time ocean observatory (see http://go.nature.com/aV6ZIF).

This is all to the good. The problem, however, is that the party will soon be over: the unexpected influx of funds will largely end a year from now. US science as a whole could all too easily hurtle over the same cliff from which the NIH fell in 2003, when a doubling of its budget over five years came to a sudden end and young investigators who had been drawn into the research pipeline during the boom years suddenly found themselves scrambling for grants in hyper-competitive lean years.

The Obama administration is hoping to avoid a repeat of that meltdown by asking Congress to double the budgets of basic-research agencies over ten years — presumably a more sustainable pace of increase. But it's far from clear whether Congress will grant such a request, or even whether such funds are warranted. In fact, one helpful project coming from the stimulus funds is an NSF programme to study the effects of short-term boosts in science and technology funding on society at large — in effect, using stimulus money to study the stimulus itself. Results, however, are not due for at least two years.

In the meantime, institutions and individual researchers need to prepare now for the end of the largesse. Too many institutions have been content just to feed at the stimulus trough, encouraging their researchers to resurrect long-dead grant proposals and resubmit them without questioning the potential pain for students and staff when the monies disappear again. Instead, universities should be thinking strategically about what actions they can take now to alleviate that pain when it comes. Such actions might include finding ways to structure the funding flow by carrying out expensive data-taking tasks now, while providing support for graduate and postdoctoral students that goes beyond the end of the stimulus.

Scientific societies and professional organizations can also help, by sending out fewer congratulatory notes about landing stimulus funding and instead urging their members to think cleverly about what to do in the aftermath. Other innovative ways about how to keep the stimulus from going to waste can be found on page 876, where high-level experts weigh in with their views.

There is no mystery about the pain that will come when funding shrinks back down. The time to start planning is now.