If you unlock it then I'm pretty sure it will work, but you might not be able to get the 3G data speeds because I think AT&T and T-Mobile run on different 3G bands so the iPhone might not have the right chip to access T-Mobile's 3G bands. I think the calling and everything else should work though, and the data should work, it will just be slower.