In 226 BC, the City of Ji fell to the invading State of Qin and the State of Yan was forced to move its capital to Liaodong. The Qin eventually ended Yan in 222 BC. The following year, the ruler of Qin, having conquered all the other states, declared himself to be the First Emperor.