From Emperor of Japan: Meiji and His World, 1852–1912, by Donald Keene (Columbia U. Press, 2005), Kindle p. 104:
Even after its defeat in the war with Chōshū, the shogunate remained the only effective central government. The most the court could do was to refuse to consent to plans made by the shogunate, especially with regard to foreign relations; it did not initiate plans of its own. The shogunate was, of course, far more experienced than the court in dealing with foreigners, but it was now faced with problems it had not encountered as long as sakoku [national seclusion] lasted.
A dispute with Russia over the future disposition of the island of Sakhalin made it necessary to send two shogunate officials to St. Petersburg to negotiate with the Russians. At the time both Japanese and Russian colonists were living on the island, giving rise to incessant clashes. The Japanese proposed that the island be divided at the fiftieth parallel; the Russians demanded the whole island but offered in exchange to yield Etorofu and three small islands to the Japanese. The negotiations dragged on, but finally, on March 18, 1867, a provisional treaty was signed that left the island open to people of both countries but urged that friendlier relations based on mutual sincerity prevail, a pious hope that could not have satisfied settlers from either country. The mission nevertheless marked an important step in the history of Japanese diplomacy: it was the first time that Japanese envoys traveled abroad to negotiate a treaty.