I heard there was one occasion where a god and his devotee fought a great battle against each other. It's the case of Lord Rama vs. Hanuman.
Being a true devotee, why did Hanuman fight against his cherished god, Lord Rama?
As far as I know, this story has no scriptural basis; it may just be folklore. The story as I remember it goes roughly as follows: the king of Kashi was once in Ayodhya, perhaps during the coronation of Rama, and he insulted the short-tempered sage Vishwamitra who was there at the time. Vishwamitra was furious and he told Rama that he wanted the king's head at his feet by sunset. Rama was duty-bound to obey, as Vishwamitra was his guru, so he promised that he would do that. The king of Kashi, terrified for his life since Rama was immeasurably powerful, sought refuge in Hanuman. Hanuman agreed to protect the king, and so Rama and Hanuman were forced to battle each other. Rama tried launching arrows at Hanuman, but the arrows fell to the ground when Hanuman kept chanting Rama's name, because Rama's name is even more powerful than his arrows. So they were at a stalemate, and then they found a way to resolve the situation: they made the king of Kashi bow down to Vishwamitra, so that technically his head would be at his feet.
I don't think this story is told in any Hindu scriptures; I originally learnt it myself from some comic book for kids. But I just found the story in the book "Hanuman's Tale: The Messages of a Divine Monkey" by Phillip Lutgendorf (pages 162-164):
[T]he king of Kashi happens to be journeying to Ayodhya to pay his respects to Rama. En route, he meets the sage Narada, who requests a favor of him. When the king agrees, Narada tells him to show respect to everyone in Rama's court, but to ignore sage Vishwamitra.... The ever-volatile Vishwamitra is enraged by the slight and informs Rama of it, calling it a stain on the honor of his court. Rama's brow darkens; he removes three arrows from his quiver and vows that he will take the life of the king of Kashi before the sun sets.... The king is trembling like a leaf, however, so Narada offers a suggest for how he might yet save himself: "Go to [Hanuman's mother] Lady Anjana and ask for her protection." ... When he then reveals that his would-be executioner is Rama hismelf, Anjana is troubled. "This will be difficult", she says, then adds, "still, I'll try." At this moment Hanuman arrives and bows at his mother's feet.... [S]he makes him, in turn, promise three times to assist her.... His mother reminds him of the great dharma of sheltering the week and of the fact that she has given her word. Hanuman says he will try to find a way out
Hanuman flies back to Ayodhya with the king and brings him to the bank of the Sarayu. He tells him to wade waist-deep into the water and remain there, repeating Rama's name. Meanwhile, Hanuman presents himself at court, bows to Rama, ... [and] asks that henceforth he be permitted to guard those who repeat Rama's name, and further, that as long as he does so, no power in the universe, - "not even God himself" - should be able to cause them harm. Rama readily agrees, whereupon Hanuman ... rushes back to the riverbank[.]... Rama is soon informed of this and becomes furious. He takes one of his arrows, charges it with mantras for the destruction of the king of Kashi, and fires it right from the palace. But the arrow halts in mid-air just in front of the king[.]...
Meanwhile, Vishwamitra too arrives on the scene, brooding over the curious crisis he preciptated. As Rama prepares to fire his arrow, Vashishta ... tells the offending king to throw himself at Vishwamitra's feet. The king does so, still repeating the mantra, and Vishwamitra is pleased and declares his act of repentance to be sufficient.
This story has no validity in any valid scriptures.
Maybe it is there in Parasara Samhita, not sure, but this Samhita itself appears to be later day work and has lot of interpolations.
So, there no validity in this story.
First of all, Hanuman being a strict devotee of Raama, will never fight Raama nor did he ever fight Raama.
Secondly, if you look at Srimad Valmiki Ramayana, Hanuman himself says that neither bramha nor siva, nor Indra etc can wage a war and win against Raama. so, neither hanuman nor anyone can stand a chance against Raama in a war.
Thirdly, in padma purana, Hanuman took on Lord Siva and his attendents and defeated all of them after the aswamedha yaga, when Siva and his retinue came to aid of a king who captured the Sacrificial Horse set loose by Lord Raama as part of Aswemedha yagna (remind you only Satrughna and Hanuman, Sugriva, Ayodhya army and Vanara army fought against Siva and his ganas. Raama, Lakshmana and Bharata were not there). This incident is in Padma Purana. Hanuman chastises Siva for fighting Satrughna and Ayodhya Army and bashes Siva and his ganas, though Siva was just trying to keep his word given to his devotee, the king who had captured the Horse. So, Hanuman, will never fight or agree to fight Rama.
So, it is very unlike, such a devote Hanuman will listen to his mother's promise about some dharma etc., and fight Raama whatever may be the reason.
This is fictitious story just to convey a message that the name of Lord Vishnu/Rama is as powerful as the Lord himself.
If you look at the Padma Purana, the very same Hanuman becomes unconciouness during a fight with Lava and Kusha, Raama's sons. Both Hanuman and Sugriva are captured by Lava and Kusha.
So, neither Hanuman nor anyone can stand a chance against Raama in a war.
So, this story has no validity in the valid Hindu scriptures.
Sri Sri Ramakrishna once mentioned an incidence: When Sri Rama arranged for the Agnipariksha (Fire trial) for Sita mata, and She was entering the flame created for the purpose, Hanumanji was very disappointed and was about to wage a war with Sri Rama. But, it is also believed that this trial was arranged by Lord Rama only to facilitate the exchange of Maya Sita with real one.
It is also believed that Sita Herself was strong enough to protect Herself from Ravana, but She did not do it for a few reasons: 1. Ravana got hold of Maya Sita only. 2. As the universal mother personified (even in Her Maya version), She will never kill any person... Nor even anybody can die in front of Her, such is Her love for all of us.
Her strength had been demonstrated in Her childhood when She used to play with the Hara Dhanu (the famous Bow of lord Shiva) that could not be moved by any of the kings (nor even by all of them together) except Shri. Rama who eventually broke it.
Please remember these are only sweet beliefs for those who have attained faith and ready to believe. I don't remember the references.
Once king of Kashi goes to Ayodhya to pay visit to Rama . On his way, Naradha meets him and asks him to do a favor for him, the king agrees for it, then Naradha asks him to pay respect to all the members in Rama's court excluding Sage Vishwamitra. The king of kashi agrees to do that. As said by Naradha, king pays respect to all the members of the court and ignores Sage Vishwamitra. Due to this activity, Vishwamitra gets angry and says to Rama that the head of the king should be on his leg by this sunset, being the student Rama agrees for this. When this situation comes to known by the King of Kashi, he gets frightened and asks for help from Hanuman. Hunuman agees to protect the king. This led to the war between Rama and his devotee Hanuman. Though, they fought they didn't harm each other as Hanuman was taking the name of Rama. when Rama was throwing arrows on him. As the name of Rama was more powerful then his arrows it didn't hurt Hanuman. At last they made king of kashi to bow to Vishwamitra and made his head come near to the sages leg which satisfied the Sage.
Friends, i believe this incident was created by Narada, to show to mankind the power of Shri Rama's name, and from what i have heard, it's Narada who mentioned to Hanuman to chant Rama's name, when Shri Rama will shoot the arrow.
Here it goes in short form.
Once king of Kashi goes to Ayodhya to pay visit to Rama . On his way, Naradha meets him and asks him to do a favor for him, the king agrees for it, then Naradha asks him to pay respect to all the members in Rama's court excluding Sage Vishwamitra. The king of kashi agrees to do that. As said by Naradha, king pays respect to all the members of the court and ignores Sage Vishwamitra. Due to this activity, Vishwamitra gets angry and says to Rama that the head of the king should be on his leg by this sunset, being the student Rama agrees for this. When this situation comes to known by the King of Kashi, he gets frightened and asks for help from Hanuman,suggested to King by Narada. Hanuman agrees to protect the king. This led to the war between Rama and his devotee Hanuman. Though, they fought they didn't harm each other as Hanuman was taking the name of Rama