The united states became independent after _____ years of war with britain, which fought hard to retain the thirteen colonies as part of the british empire.