Why is my car getting stuck in park?

I drive a 1999 Honda Accord that has had a "sticky park" for the past few days. Sometimes I can't compress the silver button that releases the shifter. There are times when it only takes a few attempts to press it in to get on my way, and other times it actually takes a good few minutes just sitting in the car trying different angles and compression forces on my brake pedal. However, it always eventually shifts.

I found out today that it is not just limited to when I turn my car on--I was dropping a friend off so I turned on my emergency lights and parked quickly at the side of the street. The friend was in and out and I thought I would be too, but after parking it for the friend to leave I was stuck trying to get it OUT of park for at least a minute.

It appeared to start last week when I had a warning light pop up for my brake lights (or at least that's when I started noticing it). The brake lights would only show up sometimes when I would press the brake pedal. The next morning when I went to check my car, there was no warning light and it appeared to work fine and I haven't seen a warning light since. I'm wondering if they're connected somehow? Maybe the car isn't registering that the brake pedal is actually down which is why it will only let me shift sometimes?

Can anyone tell me what is happening to my car to make it do that, and the best way to fix it please? Your help is appreciated!

Yes the brake lights also release the shift lock so fix the brake lights and you will fix the shifter. Try the brake light switch on the brake pedal.

It sounds like your brake lock saftey switch maybe faulty it could be your foot has partially unplugged it check for the obvious thing that it simply needs to be plugged back in or get to a mechanic to have it repaired