In 1128, near Guimarães, at the Battle of São Mamede Afonso and his supporters overcame troops under his Count Fernando Peres de Trava of Galicia.
Afonso then turned his arms against the persistent problem of the Moors in the south.