Exhibit 31.1CERTIFICATIONI, Gerard H. Brandi certify that:1. I have reviewed this annual report on Form 10-K of MASSBANK Corp. (the “Registrant”); 2. Based on my knowledge, this report does not contain any untruestatement of a material fact or omit to state a material fact necessary to make the statementsmade, in light of the circumstances under whichsuch statements were made, not misleading with respect to the period covered by this report; 3. Based on my knowledge, the financial statements, and other financialinformation included in this report, fairly present in all materialrespects the financial condition, results of operations and cashflows of the Registrant as of, and for, the periods presented in thisreport; 4. The Registrant’s other certifying officer and I are responsible forestablishing and maintaining disclosure controls and procedures (asdefined in Exchange Act Rules 13a-15(e) and 15d-15(e)) and internalcontrol over financial reporting (as defined in Exchange Act Rules13a – 15(f) and 15d – 15(f) for the Registrant and have: a) Designed such disclosure controls and procedures, or caused suchdisclosure controls and procedures to be designed under oursupervision, to ensure that material information relating to theRegistrant, including its consolidated subsidiaries, is made known tous by others within those entities, particularly during the period inwhich this report is being prepared;  b) Designed such internal control over financial reporting, or causedsuch internal control over financial reporting to be designed underour supervision, to provide reasonable assurance regarding thereliability of financial reporting and the preparation of financialstatements for external purposes in accordance with generallyaccepted accounting principles;  c) Evaluated the effectiveness of the Registrant’s disclosure controlsand procedures and presented in this report our conclusionsabout the effectiveness of the disclosure controls and procedures asof the end of the period covered by this report based on suchevaluation; and  d) Disclosed in this report any change in the Registrant’s internalcontrol over financial reporting that occurred during theRegistrant’s most recent fiscal quarter (the Registrant’sfourthquarter in the case of an annual report) that has materiallyaffected, or is reasonably likely to materially affect, theRegistrant’s internal control over financial reporting; and5. The Registrant’s other certifying officer and I have disclosed, based onour most recent evaluation of internal control over financial reporting,to the Registrant’s auditors and the audit committee of Registrant’s boardof directors (or persons performing the equivalent function): a) All significant deficiencies and material weaknesses in the design oroperation of internal control over financial reporting which arereasonably likely to adversely affect the Registrant’s ability torecord, process, summarize and report financial information; and  b) Any fraud, whether or not material, that involves management or otheremployees who have a significant role in the Registrant’sinternal control over financial reporting.        Date:  March 13, 2006 /s/Gerard H. Brandi   Gerard H. Brandi, President and CEO   (principal executive officer)