NEW YORK — MSNBC host Martin Bashir resigned from the network Wednesday, nearly three weeks after making graphic remarks on the air about former Alaska Gov. Sarah Palin.

Bashir expressed hope that the network could move beyond the distraction of “my ill-judged comments.”

Last month, Bashir had suggested that someone defecate in Palin’s mouth because of a statement she made comparing the United States’ indebtedness to China with slavery.

He apologized days later. But controversy continued to rage.

His exit after three years leaves a hole in the network’s afternoon schedule.