I understand that 'really' is an adverb when it is describing an adjective in a sentence but what if it was an exclamation as in 'Really! I had no idea that was the case.' What part of speech would it be then?
It is supposed to be an interjection, just like "Indeed!" or "You're kidding!" It can still be viewed is an adverb ("Is that really so!"), but that would be a stretch, since it can also stand in for "I can't believe some people still think that Hals and Rembrandt knew each other personally," which is a complete sentence full of various parts of speech.