The Electrify Africa Act of 2015 will give legal backing to Mr Obama’s flagship Power Africa scheme, which is trying to improve access to electricity through public-private partnerships.
It took nearly two years to be passed in both houses of the US Congress.
About two-thirds of people in Africa do not have access to reliable power.
Observers say the new legislation is likely to ensure that the scheme continues even after Mr Obama leaves the White House in 2017.
The scheme has set itself the long-term target of doubling electricity access in sub-Saharan Africa.
The legislation would “improve the lives of millions in sub-Saharan Africa by helping to reduce reliance on charcoal and other toxic fuel sources that produce fumes that kill more than HIV/Aids and malaria combined,” said House Foreign Affairs committee chairman Ed Royce, a long-time supporter of the initiative.
It would also “promote the development of affordable and reliable energy”, he added, in a statementon Monday.
Management consultant firm McKinsey estimates that it will cost $835bn (£575bn) to connect the entire continent’s population to electricity by 2030.
Aside from the US government, African governments, development partners, and the private sector are all involved in the Power Africa scheme.
The US government has made financial commitments of $7bn to support the scheme, which it says in turn has drawn a further $43bn in investment pledged from other public and private partners.