ISLAMABAD, Pakistan (CNN) -- The Pakistani military says security forces have taken back the city of Mingora from the Taliban, calling it a significant victory in its offensive against the Taliban.

Pakistani solders escort a suspected Taliban militant inside an army base in Mingora.

Mingora is the largest city in Pakistan's Swat Valley where security forces have been fighting the Taliban in a month-long offensive.

"It is a great accomplishment," said Pakistani Maj. Gen. Athar Abbas. "This is the largest city in Swat and for all practical purposes, Mingora has been secured."

Abbas said militants put up a stiff resistance, but their resistance weakened as troops moved in. Abbas told CNN pockets of militants remain just outside Mingora.

The fighting has uprooted about 2.4 million Pakistanis from their homes in the northwestern region of the country, according to the latest data from the United Nations. Of those displaced, about 10 percent -- or 240,000 -- are living in refugee camps, according to the U.N.