NEW YORK — James Franco has apologized for his Instagram flirtation with a 17-year-old.

On “Live With Kelly and Michael,” Franco said Friday that he used “bad judgment” and “learned my lesson.”

The actor and filmmaker, 35, was caught trying to pick up a Scottish teen on the photo-sharing app.

Franco said that he was embarrassed and that he’s “a model of how social media is tricky.” He said the awkward process of meeting someone was “doubly” embarrassing in the spotlight of fame.