President Obama signs the Stop Trading on Congressional Knowledge (STOCK) Act Wednesday. (Andrew Harrer/BLOOMBERG)

President 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 their work.

“We were sent here to serve the American people and look out for their interests, not to look out for our own interests,” Obama said at a signing ceremony in Washington, joined by Republican and Democratic members of Congress. “There is a deficit of trust between this city and the rest of the country.”

Obama had called for passage of the bill in his State of the Union address in January. It is called the Stock Act, for Stock Trading on Congressional Knowledge. The House passed the measure Feb. 9 by a 417 to 2 vote, and the Senate followed March 22 by a vote of 96 to 3.

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.