In Markarth After I killed the spider and that dude gave me the key to go see the Dwemer museum I go there and all the guards are fine except for the lone guard that is in the very last room of the museum. He always attacks me no matter what and I'm forced to kill him. I didn't touch any of the Valve/Traps and don't have a bounty so what gives? Everyone else outside that room and anywhere in the game treats me as if nothing ever happened but I just hope it's not going to cause problems in the future.
Oh hey, I had that happen to me too. I sheathed my weapons and he continued beating on Lydia so i just killed him and went about my business. Totally forgot about that.
You are in the wizard's sanctum and no longer in the Museum proper. It's a little confusing because there is really nothing to warn you that you are entering into a restricted area when you do it.