One of the most popular Shabbat zemirot is certainly the song "Tzur Mishelo", whose authorship is attributed to Rabbi Avraham ben Ezra though this theory is far from certain. Unlike most of the other Shabbat zemirot, Tzur Mishelo does not even mention Shabbat. Rather, it is a tribute to the Birkat Hamazon. It is also one of the most beloved of the Shabbat zemirot as it is found in virtually every siddur and embraced in every ethnic tradition.
It is noted that Tzur Mishelo only corresponds to three out of the four blessings of the Birkat Hamazon. This has led some scholars to suggest that it was written before the fourth blessing was added to the Birkat Hamazon, making it a much older zemer than we commonly assume. The fourth blessing, known as the "hatov v'hameitiv", was added to the Birkat Hamazon following the Bar Kochba revolt in appreciation of the fact that the bodies of the fighters of Beitar did not decompose and were finally brought to proper burial. Some individuals have the practice to recite Tzur Mishelo at Yom Tov meals, as well and some do so even at weekday meals, though there are authorities who believe that Tzur Mishelo should not be recited on weekdays. In order for one not to appear inconsistent with the words one recites, some authorities maintain that Tzur Mishelo should only be recited by one who has eaten both bread and wine in the current meal.
The four stanzas of Tzur Mishelo correspond to the first three blessings of the Birkat Hamazon. The first stanza which thanks God for our nourishment and having eaten from His bread closely resembles the first blessing of the Birkat Hamazon. The second stanza mentions the gift of Eretz Yisrael, as is the theme of the second blessing of the Birkat Hamazon. The third stanza mentions the kingdom of King David, as is the theme of the third blessing of Birkat Hamazon. Finally, the fourth stanza mentions the rebuilding of Jerusalem which corresponds to the theme of the third blessing of the Birkat Hamazon. Tzur Mishelo also includes the words "Harachaman hanikdash yitbarach veyitaleh al kos yayin malei", The Merciful One who is sanctified may He be blessed and exalted over a full cup of wine, which recalls the custom of reciting the Birkat Hamazon over a cup of wine. It is also taught that the refrain of "Tzur mishelo achalnu barchu emunai…" corresponds to the introductory zimun of Birkat Hamazon.
It is interesting to note that there are a small number of authorities who actually oppose the practice of singing Tzur Mishelo at meals. This is based on the concern that the similarities between Tzur Mishelo and Birkat Hamazon might actually render the recitation of Birkat Hamazon superfluous, or worse, in vain. Indeed, although our sages instituted a very specific structure and formula for the recitation of Birkat Hamazon, one can theoretically discharge one's obligation of Birkat Hamazon with any form of thanks to God for the food one has eaten. As such, one who recited Tzur Mishelo during the meal, especially if it was towards the end of the meal, might have disqualified oneself from the ability to recite Birkat Hamazon.
Nevertheless, common custom is not like this view and it is virtually universal practice to sing Tzur Mishelo at Shabbat meals as almost all halachic authorities dismiss the concerns raised above. It is argued that since one has no intention of discharging one's obligation to recite Birkat Hamazon with the singing of Tzur Mishelo, then it does not have the ability to do so. It is also noted that Tzur Mishelo is not worded in the common "baruch atah…" format which is required by rabbinic law in order to fulfill the mitzva of Birkat Hamazon. Furthermore, Tzur Mishelo contains no reference to the mitzva of brit mila or Torah study, both of which must be mentioned in the course of Birkat Hamazon in order to fully discharge the mitzva.
Another reason offered why there is no concern that Tzur Mishelo might invalidate the Birkat Hamazon is because Tzur Mishelo contains no mention of Shabbat. One who fails to mention Shabbat in the course of the Birkat Hamazon at the Shabbat meals does not fulfill the mitzva of Birkat Hamazon according to all opinions. In fact, one who recited Birkat Hamazon but did not include the special Shabbat insertion, retzei, is required to repeat the entire Birkat Hamazon. However, this is only true at the first two Shabbat meals. One who omits retzei in the Birkat Hamazon of Seudat Shlishit, the third Shabbat meal, need not repeat the Birkat Hamazon. As such, there are those who suggest not reciting Tzur Mishelo specifically at Seudat Shlishit for this reason.
It is reported that Rabbi Yaakov Yisrael Kanievsky would be sure to eat additional bread after singing Tzur Mishelo in order to demonstrate that the song did not represent his Birkat Hamazon in any way. Those who would like to conduct themselves stringently and satisfy all opinions should consider singing Tzur Mishelo only after having recited the Birkat Hamazon.
 Nitei Gavriel, Hilchot Yom Tov 34:14.
 Zecher Yehuda p.174.
 Rivevot V'yovlot 126:7.
 Rivevot Ephraim 223:10; Orchot Rabbeinu 115.
 Vayivarech David 1:36; Keter Rosh 94.
 Nishmat Shabbat 2:188.
 Kovetz Beit Aharon V'yisrael vol. 47, 49.
 Rabbi Yoel Goldman, cited in Kovetz Beit Aharon 49.
 Chessed Ometz 607.