A wireless communication device that is adapted to perform a wireless communication with a second communication device, comprising: a determination part that is adapted to determine whether the wireless communication device is connected to a relay station which performs a wireless relay communication, a communication part (26, 36) that is adapted to perform a wireless communication in a first connection mode to communicate with the second communication device through the relay station in a case that the relay station is connected, and in a case that the relay station is not connected, to perform a wireless communication in a second connection mode with the second communication device, so they do not communicate through the relay station, and characterized by a temporary communication part adapted to form a temporary communication channel to perform a wireless communication with the second communication device without connecting to the relay station, wherein in a case that the wireless communication is performed in the first communication mode, the communication part connects to the second communication device through the relay station by sending connection setting information, which is used to connect to the relay station, to the second communication device through the temporary communication channel, wherein, in a case that the wireless communication is performed in the second communication mode, the communication part is adapted to acquire direct connection setting information as connection setting information, which is used to connect to the second communication device, from the second communication device through the temporary communication channel, and to connect to the second communication device based on the direct connection setting information, and wherein the determination part is adapted to determine whether the wireless communication device is connected to the relay station, which performs the wireless relay communication, based on connection history information indicating a relay station to which the communication part (26, 36) has been connected. a determination part that is adapted to determine whether the wireless communication device is connected to a relay station which performs a wireless relay communication, a communication part (26, 36) that is adapted to perform a wireless communication in a first connection mode to communicate with the second communication device through the relay station in a case that the relay station is connected, and in a case that the relay station is not connected, to perform a wireless communication in a second connection mode with the second communication device, so they do not communicate through the relay station, and characterized by a temporary communication part adapted to form a temporary communication channel to perform a wireless communication with the second communication device without connecting to the relay station, wherein in a case that the wireless communication is performed in the first communication mode, the communication part connects to the second communication device through the relay station by sending connection setting information, which is used to connect to the relay station, to the second communication device through the temporary communication channel, wherein, in a case that the wireless communication is performed in the second communication mode, the communication part is adapted to acquire direct connection setting information as connection setting information, which is used to connect to the second communication device, from the second communication device through the temporary communication channel, and to connect to the second communication device based on the direct connection setting information, and wherein the determination part is adapted to determine whether the wireless communication device is connected to the relay station, which performs the wireless relay communication, based on connection history information indicating a relay station to which the communication part (26, 36) has been connected.