Imam Hasan (as) treaty with Muawiya (la)

حَدَّثَنَا الْمُظَفَّرُ بْنُ جَعْفَرِ بْنِ الْمُظَفَّرِ الْعَلَوِيُّ السَّمَرْقَنْدِيُّ رَضِيَ اللَّهُ عَنْهُ قَالَ حَدَّثَنَا جَعْفَرُ بْنُ مُحَمَّدِ بْنِ مَسْعُودٍ عَنْ أَبِيهِ قَالَ حَدَّثَنَا جَبْرَئِيلُ بْنُ أَحْمَدَ عَنْ مُوسَى بْنِ جَعْفَرٍ الْبَغْدَادِيِّ قَالَ حَدَّثَنِي الْحَسَنُ بْنُ مُحَمَّدٍ الصَّيْرَفِيُّ عَنْ حَنَانِ بْنِ سَدِيرٍ عَنْ أَبِيهِ سَدِيرِ بْنِ حُكَيْمٍ عَنْ أَبِيهِ عَنْ أَبِي سَعِيدٍ عَقِيصَا قَالَ‏ لَمَّا صَالَحَ الْحَسَنُ بْنُ عَلِيٍّ(ع)مُعَاوِيَةَ بْنَ أَبِي سُفْيَانَ دَخَلَ عَلَيْهِ النَّاسُ فَلَامَهُ بَعْضُهُمْ عَلَى بَيْعَتِهِ فَقَالَ(ع)وَيْحَكُمْ مَا تَدْرُونَ مَا عَمِلْتُ وَ اللَّهِ الَّذِي عَمِلْتُ خَيْرٌ لِشِيعَتِي مِمَّا طَلَعَتْ عَلَيْهِ الشَّمْسُ أَوْ غَرَبَتْ أَ لَا تَعْلَمُونَ أَنَّنِي إِمَامُكُمْ مُفْتَرَضُ الطَّاعَةِ عَلَيْكُمْ وَ أَحَدُ سَيِّدَيْ شَبَابِ أَهْلِ الْجَنَّةِ بِنَصٍّ مِنْ رَسُولِ اللَّهِ(ص)عَلَيَّ قَالُوا بَلَى قَالَ أَ مَا عَلِمْتُمْ أَنَّ الْخَضِرَ(ع)لَمَّا خَرَقَ السَّفِينَةَ وَ أَقَامَ الْجِدَارَ وَ قَتَلَ الْغُلَامَ كَانَ ذَلِكَ سَخَطاً لِمُوسَى بْنِ عِمْرَانَ إِذْ خَفِيَ عَلَيْهِ وَجْهُ الْحِكْمَةِ فِي ذَلِكَ وَ كَانَ ذَلِكَ عِنْدَ اللَّهِ تَعَالَى ذِكْرُهُ حِكْمَةً وَ صَوَاباً أَ مَا عَلِمْتُمْ أَنَّهُ مَا مِنَّا أَحَدٌ إِلَّا وَ يَقَعُ فِي عُنُقِهِ بَيْعَةٌ لِطَاغِيَةِ زَمَانِهِ إِلَّا الْقَائِمُ الَّذِي يُصَلِّي رُوحُ اللَّهِ عِيسَى ابْنُ مَرْيَمَ(ع)خَلْفَهُ فَإِنَّ اللَّهَ عَزَّ وَ جَلَّ يُخْفِي وِلَادَتَهُ وَ يُغَيِّبُ شَخْصَهُ لِئَلَّا يَكُونَ لِأَحَدٍ فِي عُنُقِهِ بَيْعَةٌ إِذَا خَرَجَ ذَلِكَ التَّاسِعُ مِنْ وُلْدِ أَخِي الْحُسَيْنِ بْنِ سَيِّدَةِ الْإِمَاءِ يُطِيلُ اللَّهُ عُمُرَهُ فِي غَيْبَتِهِ ثُمَّ يُظْهِرُهُ بِقُدْرَتِهِ فِي صُورَةِ شَابٍّ دُونَ أَرْبَعِينَ سَنَةً ذَلِكَ لِيُعْلَمَ‏ أَنَّ اللَّهَ عَلى‏ كُلِّ شَيْ‏ءٍ قَدِيرٌ

When Hasan bin Ali (ع) signed the peace treaty with Muawiyah some people came to him and blamed him for making peace. 
So Imam Hasan (ع) said, "Woe be on you, you don’t know what I did. By Allah whatever I have done is better for my followers (Shias) than everything upon which the sun rises and sets. Don’t you know that I am your Imam whose obedience is obligatory on you? And on the basis of the statement of the Messenger of Allah (ص) I am one of the chiefs of the youths of Paradise?"
All said: "Yes, indeed it is so." 

The Imam (ع) said, "Don’t you know that when Khizr (ع) made a hole in the boat, repaired the wall and killed a boy, Musa bin Imran (ع) did not like it since he was unaware of the wisdom behind those actions, while all those actions in the sight of Allah were based on wisdom and were correct? Do you know that there is none among us who did not have the allegiance of the tyrant ruler of his time around his neck, except for Qaim (عج), behind whom the Spirit of Allah, Isa bin Maryam (ع) will pray? Indeed, Allah, the Mighty and the Sublime has kept his birth secret and his person unseen so that when he reappears, he would not have the allegiance of anyone upon his neck. He is the ninth descendant of my brother, Husain (ع). He is the son of the best of the maidservants. The Almighty Allah will prolong his age during the occultation, then He would, through His power, make him appear as a youthful man of less than forty years of age so that it may be known that the Almighty Allah is powerful over everything."

[Source: Kamal al-Deen, Vol. 1, Ch. 29, Hadith. 2]