The defense, led by the Duke Margiris, took place on February 25, 1336, when the castle was besieged by the army of the Teutonic Knights. When the inhabitants of Pilėnai and the surrounding area realized that it was impossible to defend themselves any longer against the much larger enemy force, they made the decision to commit mass suicide, as well as to set the castle on fire in order to destroy all of their possessions, and anything of value to the enemy. They did this in preference to being subjugated and enslaved by the Teutonic Order, and so that their enemies' conquest would be a pyrrhic victory. At first, the inhabitants burned their possessions, set the castle ablaze, and then the men, women, and children took their own lives. Chronicles mention that there were 4,000 men defending the castle.
The exact location of Pilėnai is unknown. Zenonas Ivinskis identified the location with the Pypliai hill fort (Lithuanian: piliakalnis) where the Nevėžis River flows into the Nemunas River. Alvydas Nikžentaitis thought it was on the Molavėnai-Graužai hill fort located in the Nemakščiai elderate, in the Raseiniai district. Gintautas Zabiela suggested the nearby Ižiniškiai hill fort.
The residents of Punia are positive that their Margiris hill is the site of Pilėnai. The German historian, Johannes Voigt, claimed that the Bilionys hill fort in the Šilalė district is where the event took place. There are many other suggestions and hypotheses. The question remains unsolved.
The heroic defense of the castle was described by Władysław Syrokomla in his poem Margier. An opera Pilėnai was written about this event, by the musical composer Vytautas Klova, and the libretto was written by Jonas Mackonis. The opera was premiered in 1956, and is often performed in Lithuania. In 2001 the performances took place at the Trakai Island Castle. The Lithuanian Opera Company of Chicago, performed the work in 2006, in honor of its 50th Year Anniversary, in Chicago.