Thanks everyone for the replies.
In the process of following your advice, I realized that the CPU fan was damaged, and wasn't mounting on the board properly. As a result, the CPU was running too hot, and that's why the motherboard was shutting off. I replaced it, and now everything is fine.