By 1247, the Nicaeans had effectively surrounded Constantinople, with only the city's strong walls holding them at bay, and the Battle of Pelagonia in 1258 signaled the beginning of the end of Latin predominance in Greece. Thus, on July 25, 1261, with most of the Latin troops away on campaign, the Nicaean general Alexios Strategopoulos found an unguarded entrance to the city,[4] and entered it with his troops, restoring the Byzantine Empire for his master, Michael VIII Palaiologos.