Raja Bujang who reigned as Abdul Jalil Shah was eventually deposed in the Acehnese invasion in 1617, but restored to the Pahang throne and also installed as the new Sultan of Johor following the death of his uncle, Abdullah Ma'ayat Shah in 1623. This event led to the union of the crown of Pahang and Johor, and the formal establishment of Johor Empire.[citation needed]