I've got a 95 Montero SR with a weird electrical issue.

It started few months ago, I turned the ignition on and no lights came on the dashboard -- as if the battery was dead. Turning the ignition off and then on fixed the problem. This happened on a wet day after the car has been driven for a while. It was about a month after I installed a trailer harness.

Fast forward to yesterday, the car starts fine in the morning. A minute into idling, it almost stalls but somehow continues to run. I drive it 30 miles then turn off the engine. When I try to start it up again (a minute later), no lights come on as if the battery was completely drained. I connect jumper cables and it's as if everything is fine. The car starts right up (did not have to wait for the battery to charge). The engine almost shut off a time or two and the seat belt light has come on since.

Any ideas what might be wrong with the car? I'll double check the battery, but don't expect it to be the problem. Could it be a faulty main relay or a bad ignition switch?

Any help is appreciated. Thanks.