Group swings into the black and announces first dividend for six years