'''日中関係史'''（にっちゅうかんけいし）においては、日本と中国大陸にあった諸国家との関係の歴史を解説する。なお、本項目では、台湾にある現在の中華民国との関係についても言及するものとする。

== 先史 ==
日本列島は更新世末期から完新世初期にかけての氷河期の終了に伴う海水の浸入によってユーラシア大陸から切り離されるまでは同大陸とは地続きであったと考えられる。日本人の祖先にあたる人々の中には、現在の中国大陸にあたる地域から来た者も含まれているものと見られている。

== 古代 ==
150px|thumb|漢委奴國王印文
中国の文献に初めて安帝に献上したという記述があり、後漢と冊封関係にあった小国が九州北部に存在したことを示している。

三国志』魏書いわゆる魏志倭人伝のなかに「邪馬壹國」（邪馬台国）の女王卑弥呼が魏に朝貢したとある。その後約150年にわたり中国の史書には倭国の記述がない（ただしその期間中でも単に「東夷」と記された記事は存在しており、その中に倭国も含まれている可能性は存在するが、それを確かめることはほぼ不可能である）。

5世紀に入ると、いわゆる宋に朝貢したものである。

多利思北孤‎による遣隋使の派遣が開皇20年（600年）に初めてされたと『隋書』「にある（『日本書紀』にはこの記述はない）。一般的に有名な小野妹子の遣隋使は２回目とされる。遣隋使は合計５回派遣された。

隋が唐に変わると、遣唐使として犬上御田鍬が派遣された(630年)。663年、白村江の戦いで倭国と唐は干戈を交えたが、しばらくして国交を回復した。倭国から'''日本'''に国号を変え、多くの留学生（るがくしょう）、留学僧を派遣し、唐の先進文化の吸収に努めた。奈良時代には阿倍仲麻呂や井真成など唐王朝に仕えた日本人も現れ、一方で鑑真和上が仏法を伝えるために日本に渡った。これらの日本と中国王朝の関係は中国側から見れば冊封関係であった。但し、他国のように「○○国王」に封じるという関係ではなかったので、厳密には冊封というわけではない。

文選』などの漢籍は必須の教養とされた。

== 中世 ==

遣唐使廃止以降、唐が滅亡し、中国は五代十国の混乱状態に陥った。日本との公式の国交は途絶え、私的な貿易のみが行われるようになる。10世紀半ば、中国は宋によって再統一される。宋の時代になると、従来軽視されていた海運技術が向上し、海外貿易が盛んになった。ここに博多や敦賀で行なわれるようになっていた。その貿易に目をつけたのが、当時越前守であった肥後・美作・播磨の守を歴任してきた忠盛は瀬戸内海の輸送路を掌握し、舶来品を院に進呈し、近臣として認められるようになっていく。その後、彼の子である平清盛の代には平氏が国政の実権を握り、大輪田泊の修築などを行って、日宋貿易を盛んに推進した。この貿易によって、大量の宋銭が流入し、日本は貨幣経済の時代を迎えるようになった。また、禅宗や茶もこの時期に伝えられた。

平氏政権が滅亡した後の鎌倉時代にも日中間の正式な国交はなかったが、鎌倉幕府は民間貿易を認め、鎮西奉行が博多を統治して幕府からの御用商船を派遣するようになった。武士層が信仰した禅宗は北条得宗家も保護していたため、民間の渡来僧は貿易船に便乗して来日した。貿易は南宋末期まで行われ、モンゴルによる南宋攻撃が本格化してからも往来は継続していた。

鎌倉時代後期になると、中国を征服しつつあったモンゴル帝国（元）が二度にわたり、日本へ侵攻する。いわゆる元寇であり、一度目を文永の役（1274年）、二度目を弘安の役（1281年）という。弘安の役後、幕府は元軍の再度の襲来に備えて御家人の統制を進めたが、十分な恩賞給与がなされなかったため、戦費で窮迫した御家人達は借金に苦しむようになった。幕府は徳政令を発布して御家人の困窮に対応しようとしたが、御家人の不満は完全には解消されず、鎌倉幕府の滅亡につながることとなった。

室町時代になると、日本の海賊、倭寇が朝鮮半島や中国沿岸を襲撃するようになる。倭寇は前期と後期に大別されるが、前期倭寇が活動したのは、室町時代初期で、南北朝の動乱により中央の統制がゆるく倭寇も活動し易かった。前期倭寇は日本人が中心で、元寇に際して元軍とその支配下にあった高麗軍によって住民を虐殺された対馬・壱岐・松浦・五島列島などの住民が中心であり、「三島倭寇」と総称された。この海賊行為は、元寇に対する地方の私軍による復讐の意味合い、および、再度の侵攻への予防という側面もあったと考えられる。また、これらの地域では元寇による被害で労働力不足に陥り農業生産力が低下したために、これを補完する目的があったとも考えられている。

中国では1368年に朱元璋が明王朝を建国し、日本に対して倭寇討伐の要請をするために使者を派遣する。使者が派遣された当時、九州では南朝の懐良親王が勢威を振るっており、使者を迎えた懐良は明王朝から冊封を受け、「日本国王良懐」と称した。その後幕府から派遣された今川貞世により九州の南朝勢力が駆逐され、室町幕府三代将軍足利義満が南北朝合一を行うと、倭寇を討伐し、新たに「日本国王」として冊封を受け、勘合貿易を開始する。前期倭寇は、室町幕府や北九州の守護大名の日明貿易の独占、対馬と朝鮮の間の交易再開、朝鮮における李成桂による征討などによって下火になっていく。

勘合貿易は、室町幕府将軍が明皇帝から「日本国王」として冊封を受け、明皇帝に対して朝貢する形式で行われた。制限貿易で、1401年（応永8）から1549年（天文18）まで19回に渡り行われる。1404年（応永11年）以降は日本に対して交付される貿易許可証である勘合符を所持する事で倭寇と区別し、正式な遣明使船である事が確認できる勘合船に限られるようになり、1432年（永享4）に宣徳条約で回数などが規定される。遣明船には博多や堺などの有力商人も同乗し、明政府の許可を得た商人との間で私貿易が行われていた。日本からの輸出品は、硫黄、銅などの鉱物、扇子、刀剣、漆器や屏風等であり、輸入品は明銭（永楽通宝）、生糸、織物、書物等であった。輸入された織物や書画などは北山文化や東山文化など室町時代の文化にも影響を与えた。

応仁の乱で室町幕府が衰退すると、以降は堺を本拠とする管領家の細川氏、博多を治め、乱で兵庫をも得た大内氏、博多や堺などの有力商人が貿易を経営するようになった。1523年（大永3）の寧波の乱の結果、大内氏が権益を握り、1536年に大内義隆が遣明船派遣を再開する。1551年、大内氏が滅亡すると、遣明船派遣は途絶え、倭寇（後期倭寇）による密貿易が貿易の中心となっていった。

== 近世 ==

天下統一を達成した豊臣秀吉は朝鮮侵略を行い、援軍を派遣した明とも戦った。

また、秀吉は日本人の海外交易を統制し、倭寇を禁圧する必要から、1592年に初めて朱印状を発行してマニラ、アユタヤ、パタニになどに派遣したとされるが、この時のことはあまり資料がない。次いで、江戸幕府を成立させた徳川家康は海外交易に熱心な人物で、1601年以降、安南、スペイン領マニラ、カンボジア、シャム、パタニなどの東南アジア諸国に使者を派遣して外交関係を樹立し、 1604年に朱印船制度を実施した。これ以後、1635年まで350隻以上の日本船が朱印状を得て海外に渡航した。朱印船は必ず長崎から出航し、帰港するのも長崎であった。なお、明は日本船の来航を禁止していたので、朱印船渡航先とはなっていなかった。しかし、東南アジア諸港へ赴く朱印船の多くは中国産の生糸や絹の輸入が目的であった。太平の世の到来で高級衣料である中国絹に対する需要が増大したためである。他方、かって倭寇に苦しんだ明は日本船の中国入港を禁止しており、朝鮮の役で敵対国となってからはなおさらであった。明は中国商船の日本渡航も禁止していたが、これは徹底せず、密かに来航する中国船もあったが、十分な量ではなかった。このため明国官憲の監視が及ばず、中国商船は合法的に来航できる東南アジア諸港で日本船との出会い貿易が行われたのである。中国製品以外にも武具に使用される鮫皮や鹿皮、砂糖など東南アジア産品の輸入も行われた。日本からは銀、銅、銅銭、硫黄、刀などの工芸品が輸出された。当時中国では銀が不足していたため、朱印船の主要な交易相手である中国商人は銀を欲した。しかも当時、日本では石見銀山などで銀が盛産されており、決済手段として最も適していた。

江戸幕府の鎖国政策の進展により、幕府公認の朱印船の海外渡航すら難しくなり、1633年老中奉書船以外の海外渡航や帰国を禁止する第一次鎖国令が発令され、 1635年にはすべての日本人の海外渡航と帰国を禁止する第三次鎖国令が発令されて朱印船貿易は終末を迎えた。

鎖国政策の中で、清国とは長崎の出島において貿易が行われていた。鎖国中のため、輸入額を制限したり来航隻数を制限したりした事はあったが、江戸時代を通じで貿易は続けられた。

== 近代 ==
明治維新を断行して近代化の道を進む日本は、1870年8月、清国に対して修交提議をしたが清国はこれに応じなかった。しかし、李鴻章や曽国藩は近代国家として発展しつつある日本と通商を開くことの道理を説き、清国はついに修交に決した。かくして1871年7月に日清修好条規が調印された。これは日清相互に治外法権と領事裁判権を承認し合うことによる平等条約であった。

'''writing system, architecture, culture,  religion, philosophy, law, and political and economic interaction. When Western countries forced Japan to open trading in the mid-nineteenth century, Japan moved towards modernization (invasions and war crimes in China between 1894 and 1945 as well as modern Japan's attitude towards its past are major issues affecting current and likely, future Sino-Japanese relations.

{| class="infobox" style="text-align: center; font-size:11px; border:0"
|}

==Timeline==
===First evidences of Japan in Chinese historical records AD 0-300===

The first mention of the Emperor of the Han Dynasty gave a golden seal to Wa (Japan).  The seal itself was discovered in northern Kyūshū in the eighteenth century. From then on Japan was repeatedly recorded in Chinese historical texts, at first sporadically, but eventually continuously as Japan matured into a notable power in the region.

There is a Chinese Emperor, Wu Taibo, a king of the Wu state (located in modern Jiangsu and Zhejiang) during the Warring States era. They recorded examples of Wu traditions including ritual teeth-pulling, tattooing and carrying babies on backs. Other records at the time show that Japan already had the same customs recognized today. These include clapping during prayers, eating from wooden trays and eating raw fish (also a traditional custom of Jiangsu and Zhejiang before pollution made this impractical). Kofun era traditions appear in the records as the ancient Japanese built earthen mound tombs.

The first Japanese personage mentioned by the Wei Dynasty is Himiko, the female shaman leader of a country with hundreds of states called Yamataikoku. Modern historical linguists believe Yamatai was actually pronounced Yamato.

===Introduction of Chinese political system and culture AD 600-900===

During the Sui Dynasty and Tang Dynasty, Japan sent many students on a limited number of Imperial embassies to China, to help establish its own footing as a sovereign nation in northeast Asia. After the fall of the Korean confederated kingdom of Baekje (with whom Japan was closely allied) to combined Tang and Silla forces, Japan was forced to seek out the Chinese state on its own, which in those times was a treacherous undertaking, thus limiting the successes of Japanese overseas contacts during this time.

Important elements brought back from China (and some which were transmitted through Baekje to Japan) included Buddhist teachings, Chinese customs and culture, bureaucracy, architecture and city planning. The capital city of Kyoto was planned according to ''Chang'an.  During the Heian period, Buddhism became one of the major religions, alongside Shinto. 

The Chinese model of Imperial government did not last long in Japan. Its use ceased by the tenth century, overtaken by traditional Japanese clan and family rivalries (Soga-Mononobe, Taira-Minamoto).

===First Sino-Japanese battle===
In AD 663 the Battle of Baekgang took place, the first Sino-Japanese conflict in recorded history. The battle was part of the ancient relationships between the Korean Three Kingdoms (Samguk or Samhan), the Japanese Yamato, and Chinese dynasties. The battle itself came near the conclusion of this period with the fall of Baekje, one of the Samguk or three Korean kingdoms, coming on the heels of this battle.

The background of the battle involves Ainu in campaigns in eastern and northern Japan. As part of Silla's efforts to conquer Baekje, the battle of Baekgang was fought between Tang China, Baekje, Silla, and Yamato Japan. 

The battle itself was a catastrophic defeat for the Yamato forces. Some 300 Yamato vessels were destroyed by a combined Silla-Tang fleet of half the number of ships, and thus the aid to Baekje from Yamato could not help on the land, having been defeated at sea. Baekje fell shortly thereafter, in the same year.

Once Baekje was defeated, both Silla and Tang focused on the more difficult opponent, Koguryo, and Koguryo fell in 668 AD. For the most part, Silla, having been rivals with Baekje, also was hostile to Yamato Japan, which was seen as a brother state to Baekje, and this policy continued (with one pause between roughly AD 670-730) after Silla united most of what is now Korea and repelled Tang China from what is now the Korean peninsula. Yamato Japan was left isolated for a time and found itself having to forge ties with mainland Asia on its own, having been obstructed in the most easiest pathway by a hostile Silla.

===The prosperities of marine trading 600-1600===
Marine trades between China and Japan are well recorded, and many Chinese artifacts could be excavated. Baekje and Silla sometimes played the role of middleman, while direct commercial links between China and Japan flourished.

After 663 (with the fall of allied Baekje) Japan had no choice (in the face of hostility from Silla, which was temporarily deferred in the face of Tang imperialism - as Tang imperialism posed a threat both to Japan and unified Silla - but resumed in after 730 or so) but to directly trade with the Chinese dynasties. At first the Japanese had little long-range seafaring expertise of their own but eventually (some suggest with the aid of Baekje expatriates who fled their country when it fell) the Japanese improved their naval prowess as well as the construction of their ships.

The ports of Ningbo and Hangzhou had the most direct trading links to Japan and had Japanese residents doing business. Besides Korea during the Korean Three Kingdoms period (i.e. roughly AD 300-670), the Ryukyu Islands, once subjugated by the Japanese crown, also served as a stopover for Sino-Japanese trading. Commodities included fine porcelain, sandalwood, tea and silk. As a result of the close proximity to China (especially Jiangsu and Zhejiang), Kyushu and Ryukyu Island traditions have Chinese influences in addition to influences from Baekje. Kagoshima and Okinawa cuisine have a dish called kakuni similar to ''Dong Po Rou'' or "Su Dongpo's Pork" from Hangzhou: stewed pork (with fat) in sugar, rice vinegar, ginger and soy sauce. Fried fish or meatballs (such as Satsuma age are also traditionally from Southern China (mainly Zhejiang and Fujian). Noodle dishes (such as Hakata Ramen) and clay-pot casseroles are also Chinese influences. Okinawan palaces and dress show Chinese color styles, which use red, green, blue and gold adorned with mythical animals as opposed to naturalistic and simplistic traditional Japanese designs.

Direct trade with China was limited by the Tokugawa Shogunate after 1633, when Japan decided to close all direct links with the foreign world. Some trading was conducted by the Shimazu clan of Satsuma province through the Ryukyu Islands. Significant trading between China and Japan did not resume until the twentieth century, well into the modern age.

===Japanese piracy on China's coasts and Mongol invasions from China and Korea 1200-1600===
 
Japanese pirates were a constant problem, not only for China and Korea, but also for Japanese society, from the thirteenth century until Hideyoshi's failed invasions of Korea at the end of the sixteenth century. Japanese pirates were often from the undesirable parts of Japanese society, and the Japanese were just as happy to be (for the most part) rid of them as they were raiding more prosperous shores (at the time, Japan was ravaged by civil wars, and so while Korea, China, and the Mongol Empire were enjoying relative peace, prosperity, and wealth, the Japanese were upon hard times).

Wokou were also a major part of the reason why Kublai Khan of the Mongol Yuan Dynasty decided to invade Japan. Originally, Kublai Khan sent embassies to Hojo Tokimune (who was head of Japanese government) for the curtailment of Japanese piracy. Only after he received inadequate or disrespectful replies (one of the messengers was beheaded by the Japanese government) did Kublai Khan decide to send the Mongol Invasions of Japan. Fortunately for Japan, many of the invasion troops sabotaged the boats and the Kamikaze that destroyed the fleets. It may also be noted that the vast majority of the Mongol fleet that was destroyed was not built by Koreans or Chinese who had seafaring knowledge built up over centuries, nor was that part of the Mongol fleet captained by seasoned Korean or Chinese captains who knew the seas and turned back when it became clear that staying moored off of Kyushu was dangerous.

Japanese piracy intensified in the sixteenth century. In response, Ming Dynasty created a series of coastal forts and special troops to fight the marauders. A general renowned for fighting Japanese pirates is Qi Jiguang.

During Hideyoshi's invasions of 1592-96 and 1597-8, the Japanese used their pirates to help them in naval battles and transport, but were easily defeated by Korean admiral Yi Sun Shin's relatively small number of armored ships and turtle ships.

===Ming Dynasty's involvement to defeat Hideyoshi's Korean invasions of 1592-1598===

Mōri and Shimazu clans, Hideyoshi had the dream of eventually conquering China but needed to cross through Korea. 

When Hideyoshi received refusals to his demands by Korea to cross the country to Ming Dynasty China, he invaded Korea. In the first year of invasion in 1592, the Japanese reached as far as Manchuria under Kato Kiyomasa and fought the Jianzhou Jurchens. King Seonjo requested aid from the Ming Dynasty, but since Japanese advances were so fast, only small Ming forces were initially committed. Konishi Yukinaga, who garrisoned in Pyongyang in winter 1592, first encountered and defeated a force of 5,000 Chinese soldiers. In 1593, greater Chinese participation under General Li Rusong with an army of 45,000 took Pyongyang with artillery and drove the Japanese to the south, but the Japanese counterattacked at Pyokjekwan.

As it turned out, the Japanese were unable to keep their supply lines clear and the Korean navy, under the command of Yi Sun-shin, was able to cut off supply lines between Japan and Korea frequently, eventually causing the Japanese forces in Korea to stall for lack of supplies. By 1593, it was clear to all that the Japanese forces would be unable to continue with their advance under the conditions, and the Japanese, for the most part, retreated into a few strongholds they still controlled on the Korean mainland.

After 1593, there was a truce of about four years. During that time, Ming granted Hideyoshi the title as "King of Japan" as withdrawal conditions, but Hideyoshi felt it insulted the Emperor of Japan and demanded concessions including the daughter of the Wanli emperor. Further relations soured and war reignited. The second invasion was far less successful for Hideyoshi. The Chinese and Koreans were much more prepared and quickly confined and besieged the Japanese in the south until they were finally driven to the sea and defeated by the great Korean admiral Yi Sun Shin. The invasion was a failure but severely damaged the Korean cities, culture and countryside with huge civilian casualties (the Japanese massacred civilians in captured Korean cities). The invasions also drained Ming China's treasury and left it weak against the Manchus, who eventually destroyed the Ming Dynasty and created the Qing Dynasty in 1644.

Afterwards, Japan, under the Tokugawa Shogunate adopted a policy of isolationism until forced open by Commodore Perry in the 1850s.

===The Meiji Restoration, imperialism, wars and atrocities from 1868 to 1945===

After the arrival of Commodore Perry and the forced opening of Japan to western trading, Japan realized it needed to modernize to avoid the humiliation of China during the Shimazu and Mori clans overthrew the bakufu during the Meiji Restoration and restored the Japanese Emperor as head of state. Afterwards, military and government positions were taken by Mori and Shimazu clan members who institutionalized rapid modernization, militarization and imperialism based on Western countries. The first countries to feel Japanese Imperialism were China and Korea. 

Friction between China and Japan arose from Japan's control over the Port Arthur, but treated Russian prisoners with respect. Japanese troops participated in the Qingdao. The Japanese also issued the infamous Twenty-one Demands in 1915. After World War I, China felt betrayed by the Allied countries as China was an Allied nation but was forced to give territory in Shandong to Japan and accept the Twenty-one Demands. This culminated in the May Fourth Movement. However, Japanese imperialistic aims steadily increased over the 1920s, focusing on Manchuria. 

In the beginning of the Showa era, the Japanese wanted to occupy Manchuria for its resources, but the powerful warlord, Zhang Zuolin stood in their way. His train was bombed by Japanese agents in 1928. In 1931, Japan fully occupied Manchuria and created a new state called Manchukoku (Manchukuo), after a series of incidents culminating in the Mukden Incident and came to full scale invasion of China in July 1937.  Japan was soon able to gain control over all Chinese outlying territories. <ref name=Barnouin>{{cite book
 | last = Barnouin
 | first = Barbara
 | coauthors = Changgen, Yu
 | year = 1998
 | title = Chinese Foreign Policy During the Cultural Revolution
 | publisher = Columbia University Press
 | location = New York
 | pages = 113-116
 | id = ISBN 0-7103-0580-X
}} </ref>

The period between the Nationalist government, as it was mired in a civil war with the Northern Expedition. This period also saw the Nationalist government's pursuit in modernizing its National Revolutionary Army, through the assistance of Soviet, and later German, advisors.