[RPG] Is Spiritual Weapon considered a Spell or a Weapon for Resistance/Immunity purposes

clericdamage-resistancednd-5espells

In 5th Edition D&D there are various monsters with immunity or resistance to magic. For example, the Rakshasa is immune to spells of 6th level or lower. Many of these monsters are not also immune/resistant to magical weapons however.

If the monster is attacked with Spiritual Weapon would the immunity/resistance to magic still be in effect?

On the one hand it is a spell which attacks with a "melee spell attack" (phb 278), on the other hand the spell explicitly says it creates a weapon (although "spectral").

Is it merely a spell in the shape of a weapon (and therefore immunities will work on it) or does it conjure a temporary magical weapon (and therefore magic immunities will not work on it)?

Best Answer

Making the answer as simple as possible: a snippet of Spiritual Weapon description:

Clerics of deities who are associated with a particular weapon (as St. Cuthbert is known for his mace and Thor for his hammer) make this spell's effect resemble that weapon.

It is not a weapon. It is a 2nd level spell whose effect resembles a weapon. The Rakshasa is immune.