President Barack Obama on Friday took the rare step of blocking foreign investment in a U.S. company, invoking national-security concerns to prevent a firm owned by two Chinese nationals from acquiring four wind-farm projects in Oregon.

It marked the first time in 22 years that a U.S. president blocked a foreign acquisition in such a manner.

The...