The former US commander in Afghanistan who was forced to retire after making scathing comments to a magazine about the Barack Obama administration will take a teaching position at Yale, the university announced Monday.

The prestigious school announced that General Stanley McChrystal will take a position as a lecturer at a newly opened center on global affairs.

"General (Stanley) McChrystal will be a senior fellow with the Jackson Institute," university spokeswoman Dorie Baker told AFP.

McChrystal was swiftly relieved of his command in Kabul in June after comments attributed to him a Rolling Stone article showed he and his aides had disdain for administration officials. He retired from the military in July.

The Jackson Institute opened this year after a 50-million-dollar gift to the university. The center will offer coursework for Yale students interested in diplomatic service or careers with international agencies or nongovernmental organizations

McChrystal will teach alongside such well-known faculty as former Mexican president Ernesto Zedillo and former UN ambassador John Negroponte.