Nissan xterra alarm gone haywire

2001 xterra alarm goes off at random and will lock itself after about 3 minutes after getting out of the car. You can disarm with alarm remote and it will turn itself back on.