A friend of mine purchased an iPhone 3gs off ebay that was brand new with 3.1.3 for use with his T-Mobile plan. It stated it was unlocked and when i saw it it was jailbroken so I had assumed it was unlocked through software. He wanted to update to iOS4 so I had assumed we would update to the new software and i would need to run jailbreakme and then ultrasnow.

Since he had not downloaded anything from cydia and just got the phone I did an upgrade to 4.0.1 as opposed to a restore. We left the sim card in during the update. To my surprise when the update was done the T-mobile sim card was still valid and i did not need to jailbreak the phone to run ultrasnow. I checked the model number and it appears to be a USA iphone.

So my question is how is it possible that this phone kept the unlock after i updated the OS? Does this mean it is factory unlocked?