It is most likely your trunk actuator. I had the same problem lately but in my case, the actuator stayed in the open position which means that I could not close the trunk anymore.
Go on the BMW Tips webstie (http://www.bmwtips.com/
) in the Tips and Tricks, they have a good description on replacing it. You can buy the part at Bavauto for around $80.