During this time , Portugal experienced a series of political and military challenges , including an invasion by Napoleonic France , the cessation of Brazil ( it 's largest colony ) , and a civil war caused by royal succession ; nonetheless , Portugal remained an international power throughout the 1800s , with significant spheres of influence on all continents .