Yes. Your plea of guilty would have to be accepted by the presiding judge, following a series of questions the judge will ask you concerning your plea offer and the fact that you're giving up your rights to a fair trial, that you have been explained by your attorney all the details of the plea offer, that if you're a non-US citizen or permanent residency you can be deported, and that you are pleading guilty because you are guilty (or it's in your best interest, a plea known as an Alford plea). If the judge is satisfied that you understand these ramifications they will accept the plea offer and then sentence you accordingly.
If at any time before or during the above-mentioned questioning you want to withdraw the plea, you can do so. But once the judge accepts the plea offer and sentences you, you can't turn back.