Sounds like your sun (ambient light) sensor. Check to make sure you aren't covering it up in any way. If it reads a low light level, its going to turn the lights on.
Also wipers will trigger the lights as well. It auto turns them on when wipers are being used for any length of time.
Did your dash lights dim as well when the headlights were on? The light sensor also will try to level interior light level to match. ie, if the sensor thinks its dark outside and inside, it will dim your dash lights as well as turn on the headlights.
If it isn't related to wipers, and it dims the interior dash lights, most likely your light sensor is on the fritz and needs to be replaced.
BTW, in case you weren't aware, the black bulb looking thingy sticking up in between defrost vents in the middle of the dash right by the windshield is what I'm talking about.
I noticed I had a problem when I had my satellite radio receiver stuck to the windshield near it, and eventually moved it. No more flaky lights since that.
2004 Buick LeSabre Custom FE5 GXP suspension conversion. 170Kmi
2001 Silverado 4WD 5.3L, 33" BFG ATs, Z71/Z82 pkg, 147kmi.