The commandment was preached by Jesus at the seder, the day before his crucifixion and death. From John's Gospel, Chapter 13:
31Therefore, when he was gone out, Jesus said, Now is the Son of man glorified, and God is glorified in him.
32If God be glorified in him, God shall also glorify him in himself, and shall straightway glorify him.
33Little children, yet a little while I am with you. Ye shall seek me: and as I said unto the Jews, Whither I go, ye cannot come; so now I say to you.
34A new commandment I give unto you, That ye love one another; as I have loved you, that ye also love one another.
35By this shall all men know that ye are my disciples, if ye have love one to another.