WASHINGTON—President Barack Obama says he will ban the use of solitary confinement for juvenile and low-level offenders in federal prisons, citing the potential for “devastating, lasting psychological consequences” from the use of the isolation as punishment.

“It has been linked to depression, alienation, withdrawal, a reduced ability to interact with others and the potential for violent behavior,” Mr. Obama wrote in an op-ed posted Monday evening on The Washington Post’s website. “Some studies indicate that it can worsen existing...