(Bloomberg News) President Barack Obama signed into law a bill strengthening the ban on insider trading by members of Congress and other government officials who might profit on private knowledge they gain from work.

The president had called for passage of the bill, S. 2038, in his State of the Union message in January. It is called the Stock Act, for Stock Trading on Congressional Knowledge.

The law prohibits lawmakers, their staffs and some executive branch employees from trading stocks, commodities or futures based on private information they learn on the job. It would prevent lawmakers from participating in initial public offerings that aren't available to the general public.

Under terms of the new law, more than 28,000 senior government officials who already must file public disclosures, including the president, the vice president, cabinet members, lawmakers and their staffs, must publicly report all trades valued at $1,000 or more within 30 days after they are informed of the transaction, and in no case any later than 45 days after the transaction occurred. The rule wouldn't apply to widely held investment funds.

The House passed the measure Feb. 9 by a 417-2 vote, and the Senate followed March 22 by a vote of 96-3.

Bills to tighten insider-trading rules on members of Congress had languished until late last year, when CBS's "60 Minutes" program reported that lawmakers could legally trade stock based on non-public information, giving the legislation new urgency.

The law also blocks bonuses for Fannie Mae, Freddie Mac executives while the companies remain under government conservatorship.