It is a well-known fact that Lord Shiva does not mind to fight with the Supreme Lord in order to fulfill the desire of his dear devotee. There are many examples in Shastra to substantiate this fact. When Krsna was residing at Dvārkā, a king named Kashiraja, who was a devotee of Shiva, prayed to him for help so that he could conquer Dvārakā.
In response, Lord Shiva promised to fight against Krishna. In the battle that ensued, not only did Lord Shiva fight, he even used his supreme weapon, the Pāshupata, against Krsna. But, Sri Krishna cut off the head of Kashiraja with His Vaisnava weapon, Sudarshan, and burnt the entire city of Kāshi to ashes.
Lord Shiva was very unhappy because he was unable to protect his own devotee. But, what could he do? Wherever there is the Supreme Personality of Godhead, and His weapon, Sudarshana, all power of opposition is useless.
Lord Shiva was chased by Sudarshana and finally, when he realized his offense, he fell at the lotus feet of to beg pardon. Lord Shiva then promised not to do any such thing in the future.
By the order of the SupremeLord, so that he could spend his time in the service to the Supreme Lord, Lord Shiva was awarded the place called Bhuvaneshvara, near Jagannātha Puri. Even today, he is present there as Lingarāja-mahādeva.
Sri Krsna appeared in this world and engaged in rāsa-lilā pastimes with the gopis, headed by Sri Rādhikā, in Vrndāvana. One day, Lord Shiva, the foremost Vai}nava,with a desire to see Krsna’s rāsalilā pastimes,assumedthe form of a cowherd girl and entered the arena of the rāsa dance. However, he was immediately discovered by the gopis of Braja and later on, his actual identity as Lord Shiva was exposed. He was then removed from the arena of the rāsa dance. Ever since that time, he has been residing in Vrndāvana as Gopishvara Mahādeva having taken a vow to engage in the service of Sri Krsna.
Lord Shiva is an associate and devotee of the Supreme Lord. It is by the mercy of a devotee that one develops devotion for the Supreme Lord. He is one of the twelve mahājanas described in the Srimad Bhāgavatam.