Corporations would be permitted to donate directly to political candidates for the first time in more than a century under a ruling issued late Thursday by a federal district judge in Virginia.

The ruling is almost certain to be appealed, and it isn't expected to have a big impact on the 2012 elections for president and Congress. But it is the latest in a string of court decisions that loosen restrictions on spending by companies and unions in elections.

The...