The 193-member world body didn't directly accuse Iran of involvement, but it called on the Islamic Republic to comply with international law.
Iran, which has vehemently denied any involvement, tried unsuccessfully to have all references to it removed from the Saudi-sponsored resolution.
But the General Assembly approved the resolution late Friday by a vote of 106-9 with 40 abstentions.
Saudi Arabia's U.N. Ambassador Abdullah Al-Mouallimi told the assembly before the vote that the time has come to say "enough terrorism, enough of attacking diplomats."