Pakistani premier Nawaz Sharif has accepted Indian prime minister-elect Narendra Modi's invitation to attend his swearing-in, his office said Saturday, in a bold diplomatic move aimed at mending strained ties.