Muhammad continued the policy of peace with all neighbours, and had good relations with both Abu Salim of the Marinids (r. 1359–1361) and Peter I of Castile. However, in 1358, he was embroiled in the War of the Two Peters between Peter I and Peter IV of Aragon. Castile demanded Granada's financial and military contributions as its vassal. Muhammad's decision to enter the war angered many at court and was one factor that facilitated Ismail's rise to the throne.