Gustafsson made his UFC 105 debut against Jared Hamman on November 14, 2009. Gustafsson put Hamman down with a straight right kick and won the fight by knockout in the first roud at 0:41.
His next fight was against Phil Davis on April 10, 2010 at UFC 112. Gustafsson lost the fight with a painful "anaconda hold.
His next opponent was MMA face and veteran kickboxer Cyril Diabate at UFC 120.
In his next fight, as in the past, Gustafsson won by choke over James Te-Hun in the first round at UFC 127.
On December 30, 2011, at UFC 141, Gustafsson had a fight against Matyushenko. Alexander won by TKO in the first round.
Gustafsson was expected to face Antonio Rogerio Nogueira on April 14, 2012 at UFC Fuel TV 2 in Stockholm, but Nogueira withdrew due to injury and was replaced by Tiago Silva. Gustafsson dominated the fight and won by unanimous decision.
On September 21, 2013, at UFC 165, Gustafsson lost by unanimous decision to UFC bantamweight champion Jon Jones.