The present day structure was built by the mughals thought a fort had stood there since at least the 11th century . Agra fort was originally a brick fort known as badalgarh held by raja badal singh hindu sikarwar rajput king .it was mentioned for the agra and lived in the fort .he governed the country from here and agra assumed the impkrtance of the second capital. He died in the fort in 1517 and his son lbrahim lodi held it for nine year until he was defeated and killed at panipat in 1526. Several palaces well and a mosque were built by him in the fort during his period
After the first battle of panipat in 1526. The victorios babur stayed in the fort in the place of lbrahim lodi.he later built a baoli in it. Realising the importance of its central situation.