General Sharif was speaking at the 'Change of Command' ceremony at the General Headquarters in the garrison town in Rawalpindi, capital Islamabad's twin city, the military's media wing said.
General Qamar Javed Bajwa officially took charge as the 16th army chief of Pakistan during the ceremony, the media wing said.
In his farewell speech at the ceremony, attended by former army chiefs, federal ministers and foreign diplomats, Gen Raheel Sharif stressed the need for institutions to work together for the nation's progress, and cautioned India against adopting an aggressive stance in the region.
"India should know that mistaking our policy of patience for weakness would be dangerous," General Sharif said.
Raheel Sharif said he always prioritised national interest in every decision he made during his tenure. But the security situation in the region remains "complicated".
General Qamar Bajwa has spent a considerable part of his military service in the Rawalpindi-based 10 Corps, which is posted on the Line of Control (LoC). However, his time at the 10 Corps was a period of relative quiet following the 2003 ceasefire accord.
He, however, takes command amid heightened tensions on the LoC.
As a person, General Bajwa is said to be witty, well-connected with the troops and not fond of being in the limelight.
He is the fourth officer from the infantry's Baloch Regiment to become the army chief. Before him, Gen. Yahya Khan, Gen. Aslam Beg and Gen. Kayani rose to that position.