Police have arrested a man in connection with Tuesday's fatal stabbing on the Upper East Side. Gustavo Rodriguez, 19, of East Harlem, is accused in the early-morning killing of Xavier Olivares, 22, on Third Avenue between East 94th and East 95th Streets, which may have been over a woman.

Rodriguez was with Olivares's ex-girlfriend at the time of the stabbing, and though she initially told cops the attack was random, they now believe it was motivated by jealousy. When Olivares spotted the two together on the street, he and Rodriguez got into a loud argument, which allegedly ended with Rodriguez sinking a knife into the other man's chest repeatedly. The woman helped Olivares flag down a cab, and the driver rushed them to Metropolitan Hospital, where Olivares died within two hours of the attack.

Rodriguez and the woman reportedly work together at a sushi restaurant on Third Avenue.

The Daily News spoke to Olivares's uncle, who described him as a hardworking pizza shop employee and told the tabloid, "It just doesn’t make any sense." The victim had a 1-year-old daughter with the woman.

Rodriguez is being charged with murder, weapons possession, and assault.