23 or 20 Yr old male having Sex with a 17 year old female

Michigan

I'm 20 and my friend is 23. We just found out that a girl we both like and thought was 18, lied and is really 17. Is it legal for me to have sex with her since I am not over 21? and is it illegal for him to have sex with her since he is more than 4 years older than her and she is still under the "age of majority" which is 18 yrs old in Michigan? If it is illegal for one or both of us, what would be the penalty considering that she lied about her age? Does it matter what her parents think?

The age of consent in Michigan is 16 which means if you had consensual sex with a 17 year old, you would not be in violation of Michigan sexual offense laws for criminal sexual conduct; unless, the adult is a teacher or school administrator in the school where the minor is a student, in which case the age of consent changes to 18. See below.

There appears to be no affirmative defense to ignorance of age. In otherwords, if she were under the age of consent and she lied about her age, it is not likely the court would allow this as a defense to the crime. There are only a handful of states that will allow this as an affirmative defense.

750.520e Criminal sexual conduct in the fourth degree;

1) A person is guilty of criminal sexual conduct in the fourth degree if he or she engages in sexual "contact" with another person and if any of the following circumstances exist:
(a) That other person is at least 13 years of age but less than 16 years of age, and the actor is 5 or more years older than that other person.
(f) That other person is at least 16 years of age but less than 18 years of age and a student at a public or nonpublic school, and the actor is a teacher, substitute teacher, or administrator of that public or nonpublic school. This subdivision does not apply if the other person is emancipated or if both persons are lawfully married to each other at the time of the alleged violation.
(2) Criminal sexual conduct in the fourth degree is a misdemeanor punishable by imprisonment for not more than 2 years or a fine of not more than $500.00, or both.