As per Wikipedia Rohtas Fort is a garrison fort built by the great Afghan king Sher Shah Suri. This fort is the first example of the successful amalgamation of Pashtun and Hindu architecture in the Indian Subcontinent. Sher Shah constructed Qila Rohtas to block Emperor Humayun’s return to India after defeating him in the Battle of Kanauj. The other reason was to suppress the local tribe of this region Potohar called Gakhars. You can find more details about the fort in the documentary video below.