The rare agreement on a Syria statement condemned the attack "in the strongest terms" and came after Russia rejected an initial text on Wednesday's incident and proposed a diluted version calling on both Turkey and Syria to exercise restraint.
Western council members objected to Moscow's text but revised the original draft to accommodate some Russian concerns.
Consensus within the council on anything related to Syria is unusual and it has been deadlocked on the issue of the country's 18-month-long conflict for more than a year, with Russia and China rejecting calls to sanction the Damascus government.
The text of the final statement from the 15-member Security Council "called on the Syrian Government to fully respect the sovereignty and territorial integrity of its neighbors" and "demanded that such violations of international law stop immediately and are not repeated."
"The members of the Security Council underscored that this incident highlighted the grave impact the crisis in Syria has on the security of its neighbors and on regional peace and stability," it said.
The mortar attack happened on Wednesday and Turkey responded by striking targets in Syria later the same day and on Thursday.
Instead of explicitly calling on both Turkey and Syria to exercise restraint, the final sentence of the declaration read: "The members of the Security Council called for restraint."
Russia insisted on removing a sentence in the original draft calling the Syrian attack "a serious threat to international peace and security." The compromise text referred instead to concerns as to the impact of the crisis in Syria on "the security of its neighbors and on regional peace and stability."
Russia and China have vetoed three resolutions condemning Syrian President Bashar al-Assad's government and diplomats say it is unlikely the Security Council will take further action on Syria for the time being.